<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Well we could add both as sysfs file(s).<br>
    <br>
    Question here is rather what is the primary use case of this and if
    the application has the necessary access permissions to the sysfs
    files?<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <div class="moz-cite-prefix">Am 10.05.21 um 15:42 schrieb Nieto,
      David M:<br>
    </div>
    <blockquote type="cite"
cite="mid:BYAPR12MB2840BA4077C73311A671CCBEF4549@BYAPR12MB2840.namprd12.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <div>
        <div>
          <div dir="ltr" style="color: rgb(0, 0, 0); background-color:
            rgb(255, 255, 255);">
            Then the application would need to issue the ioctl and then
            open a sysfs file to get all the information it needs. It
            makes little sense from a programming perspective to add an
            incomplete interface in my opinion </div>
        </div>
        <div><br>
        </div>
      </div>
      <hr style="display:inline-block;width:98%" tabindex="-1">
      <div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
          face="Calibri, sans-serif" color="#000000"><b>From:</b> Gu,
          JiaWei (Will) <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
          <b>Sent:</b> Monday, May 10, 2021 12:13:07 AM<br>
          <b>To:</b> Nieto, David M <a class="moz-txt-link-rfc2396E" href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a><br>
          <b>Cc:</b> Alex Deucher <a class="moz-txt-link-rfc2396E" href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>; amd-gfx
          list <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook
          <a class="moz-txt-link-rfc2396E" href="mailto:keescook@chromium.org"><keescook@chromium.org></a>; Deng, Emily
          <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a><br>
          <b>Subject:</b> RE: [PATCH] drm/amdgpu: Align serial size in
          drm_amdgpu_info_vbios</font>
        <div> </div>
      </div>
      <div class="BodyFragment"><font size="2"><span
            style="font-size:11pt;">
            <div class="PlainText">[AMD Official Use Only - Internal
              Distribution Only]<br>
              <br>
              Hi David,<br>
              <br>
              What I meant is to ONLY delete the serial[16] from
              drm_amdgpu_info_vbios, not the whole struct.<br>
              <br>
              struct drm_amdgpu_info_vbios {<br>
                      __u8 name[64];<br>
                      __u32 dbdf;<br>
                      __u8 vbios_pn[64];<br>
                      __u32 version;<br>
                      __u8 date[32];<br>
                      __u8 serial[16]; // jiawei: shall we delete this<br>
                      __u32 dev_id;<br>
                      __u32 rev_id;<br>
                      __u32 sub_dev_id;<br>
                      __u32 sub_ved_id;<br>
              };<br>
              <br>
              serial[16] in drm_amdgpu_info_vbios  copied from
              adev->serial, but there's already a sysfs named
              serial_number, which exposes it already.<br>
              <br>
              static ssize_t amdgpu_device_get_serial_number(struct
              device *dev,<br>
                              struct device_attribute *attr, char *buf)<br>
              {<br>
                      struct drm_device *ddev = dev_get_drvdata(dev);<br>
                      struct amdgpu_device *adev = ddev->dev_private;<br>
              <br>
                      return snprintf(buf, PAGE_SIZE, "%s\n",
              adev->serial);<br>
              }<br>
              <br>
              Thanks,<br>
              Jiawei<br>
              <br>
              <br>
              -----Original Message-----<br>
              From: Nieto, David M <a class="moz-txt-link-rfc2396E" href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a> <br>
              Sent: Monday, May 10, 2021 2:53 PM<br>
              To: Gu, JiaWei (Will) <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
              Cc: Alex Deucher <a class="moz-txt-link-rfc2396E" href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>; amd-gfx
              list <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook
              <a class="moz-txt-link-rfc2396E" href="mailto:keescook@chromium.org"><keescook@chromium.org></a>; Deng, Emily
              <a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a><br>
              Subject: Re: [PATCH] drm/amdgpu: Align serial size in
              drm_amdgpu_info_vbios<br>
              <br>
              No, this structure contains all the details of the vbios:
              date, serial number, name, etc.<br>
              <br>
              The sysfs node only contains the vbios name string<br>
              <br>
              > On May 9, 2021, at 23:33, Gu, JiaWei (Will)
              <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a> wrote:<br>
              > <br>
              > [AMD Official Use Only - Internal Distribution Only]<br>
              > <br>
              > With a second thought,<br>
              > __u8 serial[16] in drm_amdgpu_info_vbios is a bit
              redundant, sysfs serial_number already exposes it.<br>
              > <br>
              > Is it fine to abandon it from drm_amdgpu_info_vbios
              struct? @Alex <br>
              > Deucher @Nieto, David M<br>
              > <br>
              > Best regards,<br>
              > Jiawei<br>
              > <br>
              > -----Original Message-----<br>
              > From: Alex Deucher <a class="moz-txt-link-rfc2396E" href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a><br>
              > Sent: Sunday, May 9, 2021 11:59 PM<br>
              > To: Gu, JiaWei (Will) <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
              > Cc: amd-gfx list
              <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook <br>
              > <a class="moz-txt-link-rfc2396E" href="mailto:keescook@chromium.org"><keescook@chromium.org></a><br>
              > Subject: Re: [PATCH] drm/amdgpu: Align serial size in
              <br>
              > drm_amdgpu_info_vbios<br>
              > <br>
              >> On Sat, May 8, 2021 at 2:48 AM Jiawei Gu
              <a class="moz-txt-link-rfc2396E" href="mailto:Jiawei.Gu@amd.com"><Jiawei.Gu@amd.com></a> wrote:<br>
              >> <br>
              >> 20 should be serial char size now instead of 16.<br>
              >> <br>
              >> Signed-off-by: Jiawei Gu
              <a class="moz-txt-link-rfc2396E" href="mailto:Jiawei.Gu@amd.com"><Jiawei.Gu@amd.com></a><br>
              > <br>
              > Please make sure this keeps proper 64 bit alignment
              in the structure.<br>
              > <br>
              > Alex<br>
              > <br>
              > <br>
              >> ---<br>
              >> include/uapi/drm/amdgpu_drm.h | 2 +-<br>
              >> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
              >> <br>
              >> diff --git a/include/uapi/drm/amdgpu_drm.h <br>
              >> b/include/uapi/drm/amdgpu_drm.h index
              2b487a8d2727..1c20721f90da<br>
              >> 100644<br>
              >> --- a/include/uapi/drm/amdgpu_drm.h<br>
              >> +++ b/include/uapi/drm/amdgpu_drm.h<br>
              >> @@ -957,7 +957,7 @@ struct drm_amdgpu_info_vbios
              {<br>
              >>        __u8 vbios_pn[64];<br>
              >>        __u32 version;<br>
              >>        __u8 date[32];<br>
              >> -       __u8 serial[16];<br>
              >> +       __u8 serial[20];<br>
              >>        __u32 dev_id;<br>
              >>        __u32 rev_id;<br>
              >>        __u32 sub_dev_id;<br>
              >> --<br>
              >> 2.17.1<br>
              >> <br>
              >> _______________________________________________<br>
              >> amd-gfx mailing list<br>
              >> <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
              >> <a
href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis"
                moz-do-not-send="true">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis</a><br>
              >> t <br>
              >>
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7CJ<br>
              >> i<br>
              >>
              awei.Gu%40amd.com%7Ccea31833184c41e8574508d9130360cc%7C3dd8961fe4884e<br>
              >> 6 <br>
              >>
              08e11a82d994e183d%7C0%7C0%7C637561727523880356%7CUnknown%7CTWFpbGZsb3<br>
              >> d <br>
              >>
              8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7<br>
              >> C <br>
              >>
1000&amp;sdata=kAJiC6WoJUTeExwk6ftrLfMoY2OTAwg9X7mGgJT3kLk%3D&amp;res<br>
              >> e<br>
              >> rved=0<br>
            </div>
          </span></font></div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
amd-gfx mailing list
<a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>