<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    I strongly recommend installing coding style setting for your
    favorite editor.<br>
    <br>
    Those should be available for pretty much every more widely used
    code editor.<br>
    <br>
    Regards,<br>
    Christian.<br>
    <br>
    <div class="moz-cite-prefix">Am 31.05.22 um 15:17 schrieb Sharma,
      Shashank:<br>
    </div>
    <blockquote type="cite" cite="mid:MW4PR12MB566785B08BAAFE3386ECD8F9F2DC9@MW4PR12MB5667.namprd12.prod.outlook.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]-->
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}div.WordSection1
        {page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal">It’s not correct even in the snapshot <span style="font-family:"Segoe UI Emoji",sans-serif">
            😃</span>. <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><img style="width:7.375in;height:2.3958in" id="Picture_x0020_1" src="cid:part1.xCh6yMBB.WoMIM016@amd.com" class="" width="708" height="230"><o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">The *<b>a</b>*dev->reset_dump line
          should start just below the open brace in the line above
          “dumps*(*adev->reset”.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Check the Linux kernel coding guidelines
          for extending the line below the open brace.
          <o:p></o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">Regards<o:p></o:p></p>
        <p class="MsoNormal">Shashank<o:p></o:p></p>
        <div>
          <div style="border:none;border-top:solid #E1E1E1
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b>From:</b> Somalapuram, Amaranath
              <a class="moz-txt-link-rfc2396E" href="mailto:Amaranath.Somalapuram@amd.com"><Amaranath.Somalapuram@amd.com></a>
              <br>
              <b>Sent:</b> Tuesday, May 31, 2022 3:09 PM<br>
              <b>To:</b> Sharma, Shashank
              <a class="moz-txt-link-rfc2396E" href="mailto:Shashank.Sharma@amd.com"><Shashank.Sharma@amd.com></a>; Somalapuram, Amaranath
              <a class="moz-txt-link-rfc2396E" href="mailto:Amaranath.Somalapuram@amd.com"><Amaranath.Somalapuram@amd.com></a>;
              <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
              <b>Cc:</b> Koenig, Christian
              <a class="moz-txt-link-rfc2396E" href="mailto:Christian.Koenig@amd.com"><Christian.Koenig@amd.com></a>; Deucher, Alexander
              <a class="moz-txt-link-rfc2396E" href="mailto:Alexander.Deucher@amd.com"><Alexander.Deucher@amd.com></a><br>
              <b>Subject:</b> Re: [PATCH v2 1/2] drm/amdgpu: save the
              reset dump register value for devcoredump<o:p></o:p></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p><o:p> </o:p></p>
        <div>
          <p class="MsoNormal">On 5/26/2022 3:24 PM, Sharma, Shashank
            wrote:<o:p></o:p></p>
        </div>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">Hey Amar, <br>
            <br>
            On 5/26/2022 11:48 AM, Somalapuram Amaranath wrote: <br>
            <br>
            <o:p></o:p></p>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">Allocate memory for register value and
              use the same values for devcoredump.
              <br>
              v1 -> V2: Change krealloc_array() to kmalloc_array() <br>
              <br>
              Signed-off-by: Somalapuram Amaranath <a href="mailto:Amaranath.Somalapuram@amd.com" moz-do-not-send="true">
                <Amaranath.Somalapuram@amd.com></a> <br>
              --- <br>
                drivers/gpu/drm/amd/amdgpu/amdgpu.h         | 1 + <br>
                drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 +++++++
              <br>
                drivers/gpu/drm/amd/amdgpu/amdgpu_device.c  | 6 +++--- <br>
                3 files changed, 11 insertions(+), 3 deletions(-) <br>
              <br>
              diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
              b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
              <br>
              index 76df583663c7..c79d9992b113 100644 <br>
              --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h <br>
              +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h <br>
              @@ -1042,6 +1042,7 @@ struct amdgpu_device { <br>
                      /* reset dump register */ <br>
                    uint32_t                       
              *reset_dump_reg_list; <br>
              +    uint32_t            *reset_dump_reg_value; <br>
                    int                             num_regs; <br>
                      struct amdgpu_reset_domain    *reset_domain; <br>
              diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
              b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
              <br>
              index eedb12f6b8a3..f3ac7912c29c 100644 <br>
              --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c <br>
              +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c <br>
              @@ -1709,17 +1709,24 @@ static ssize_t
              amdgpu_reset_dump_register_list_write(struct file *f,
              <br>
                        i++; <br>
                    } while (len < size); <br>
                +    new = kmalloc_array(i, sizeof(uint32_t),
              GFP_KERNEL); <br>
              +    if (!new) { <br>
              +        ret = -ENOMEM; <br>
              +        goto error_free; <br>
              +    } <br>
                    ret =
              down_write_killable(&adev->reset_domain->sem); <br>
                    if (ret) <br>
                        goto error_free; <br>
                      swap(adev->reset_dump_reg_list, tmp); <br>
              +    swap(adev->reset_dump_reg_value, new); <br>
                    adev->num_regs = i; <br>
                    up_write(&adev->reset_domain->sem); <br>
                    ret = size; <br>
                  error_free: <br>
                    kfree(tmp); <br>
              +    kfree(new); <br>
                    return ret; <br>
                } <br>
                diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
              b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
              <br>
              index 4daa0e893965..866b4980a6fa 100644 <br>
              --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c <br>
              +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c <br>
              @@ -4720,15 +4720,15 @@ int
              amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,
              <br>
                  static int amdgpu_reset_reg_dumps(struct amdgpu_device
              *adev) <br>
                { <br>
              -    uint32_t reg_value; <br>
                    int i; <br>
                     
              lockdep_assert_held(&adev->reset_domain->sem); <br>
                    dump_stack(); <br>
                      for (i = 0; i < adev->num_regs; i++) { <br>
              -        reg_value =
              RREG32(adev->reset_dump_reg_list[i]); <br>
              -       
              trace_amdgpu_reset_reg_dumps(adev->reset_dump_reg_list[i],
              reg_value); <br>
              +        adev->reset_dump_reg_value[i] =
              RREG32(adev->reset_dump_reg_list[i]); <br>
              +       
              trace_amdgpu_reset_reg_dumps(adev->reset_dump_reg_list[i],
              <br>
              +                adev->reset_dump_reg_value[i]); <o:p></o:p></p>
          </blockquote>
        </blockquote>
        <p>Alignment is showing spaces in email. But its 2 tabs in code.<o:p></o:p></p>
        <p class="MsoNormal"><br>
          Regards,<br>
          S.Amarnath <o:p></o:p></p>
        <p><o:p> </o:p></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal">Please fix the alignment with the line
            above, after that, please feel free to use:
            <br>
            Reviewed-by: Shashank Sharma <a href="mailto:shashank.sharma@amd.com" moz-do-not-send="true"><shashank.sharma@amd.com></a>
            <br>
            <br>
            - Shashank <br>
            <br>
            <o:p></o:p></p>
          <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
            <p class="MsoNormal">      } <br>
                      return 0; <o:p></o:p></p>
          </blockquote>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </body>
</html>