<div dir="ltr"><div>I think just applying your patch is fine for drm-next (i'll take care of that).  For 5.14.x and 5.15.x, we can just cherry-pick <span><span>afd1818.</span></span></div><div><span><span><br></span></span></div><div><span><span>Alex<br></span></span></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 3, 2021 at 11:54 AM Zhu, James <<a href="mailto:James.Zhu@amd.com">James.Zhu@amd.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:rgb(0,0,255);margin:5pt" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Alex,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
The following two patches were introduced for <a href="mailto:stable@vger.kernel.org" target="_blank">stable@vger.kernel.org</a><br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<pre>714d9e4 drm/amdgpu: init iommu after amdkfd device init
f02abeb drm/amdgpu: move iommu_resume before ip init/resume</pre>
after commit <span>  970eae15600a883e4ad27dd0757b18871cc983ab
<div>Merge: 27f4432 3906fe9    BackMerge tag 'v5.15-rc7' into drm-next,</div>
<div>It became redundant and overwrote afd1818.</div>
<div><br>
</div>
<div>I saw that you just submit (<span>afd1818</span>) "<span>[PATCH] drm/amdkfd: fix boot failure when iommu is disabled in Picasso</span>" to <a href="mailto:stable@vger.kernel.org" target="_blank">stable@vger.kernel.org</a>.
<br>
</div>
<div><br>
</div>
<div>I checked that if we re-applied <span><span>afd1818</span></span> on current drm-next, it did the same thing as my patch after auto-merged.</div>
<div><br>
</div>
<div>I am wondering if <span>BackMerge <span>stable</span> into <span>drm-next</span> in the future will correct current break.</span></div>
<div><span><br>
</span></div>
<div><span>For the above situation, I am not sure what is the proper way to fix this break.</span></div>
<div><span><br>
</span></div>
<div><span>Please let me know your final decision with all these information.</span><br>
</div>
<div>   <span><span>    </span><span></span></span><br>
</div>
</span></div>
<div>
<div id="gmail-m_2067639188724892741Signature">
<div>
<div id="gmail-m_2067639188724892741divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p style="margin-top:0px;margin-bottom:0px">Thanks & Best Regards!</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">James Zhu<br>
</p>
</div>
</div>
</div>
</div>
<div id="gmail-m_2067639188724892741appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_2067639188724892741divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
<b>Sent:</b> Wednesday, November 3, 2021 11:03 AM<br>
<b>To:</b> Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
<b>Cc:</b> amd-gfx list <<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>>; Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Zhang, Yifan <<a href="mailto:Yifan1.Zhang@amd.com" target="_blank">Yifan1.Zhang@amd.com</a>>; James Zhu <<a href="mailto:jzhums@gmail.com" target="_blank">jzhums@gmail.com</a>>; Ken Moffat <<a href="mailto:zarniwhoop@ntlworld.com" target="_blank">zarniwhoop@ntlworld.com</a>><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: remove duplicated kfd_resume_iommu</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div>Reverting <span>714d9e4 and  f02abeb results in this diff which is more than this patch does.  Is that correct or should I just use your patch?</span></div>
<div><span><br>
</span></div>
<div><span>Alex<br>
</span></div>
<div><span><br>
</span></div>
<div><span>diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
index e56bc925afcf..70540712ff2d 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -2360,6 +2360,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)<br>
        if (r)<br>
                goto init_failed;<br>
 <br>
+       r = amdgpu_amdkfd_resume_iommu(adev);<br>
+       if (r)<br>
+               goto init_failed;<br>
+<br>
        r = amdgpu_device_ip_hw_init_phase1(adev);<br>
        if (r)<br>
                goto init_failed;<br>
@@ -2398,10 +2402,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)<br>
        if (!adev->gmc.xgmi.pending_reset)<br>
                amdgpu_amdkfd_device_init(adev);<br>
 <br>
-       r = amdgpu_amdkfd_resume_iommu(adev);<br>
-       if (r)<br>
-               goto init_failed;<br>
-<br>
        amdgpu_fru_get_product_info(adev);<br>
 <br>
 init_failed:<br>
@@ -3119,10 +3119,6 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)<br>
 {<br>
        int r;<br>
 <br>
-       r = amdgpu_amdkfd_resume_iommu(adev);<br>
-       if (r)<br>
-               return r;<br>
-<br>
        r = amdgpu_device_ip_resume_phase1(adev);<br>
        if (r)<br>
                return r;<br>
@@ -4595,10 +4591,6 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,<br>
                                dev_warn(tmp_adev->dev, "asic atom init failed!");<br>
                        } else {<br>
                                dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n");<br>
-                               r = amdgpu_amdkfd_resume_iommu(tmp_adev);<br>
-                               if (r)<br>
-                                       goto out;<br>
-<br>
                                r = amdgpu_device_ip_resume_phase1(tmp_adev);<br>
                                if (r)<br>
                                        goto out;<br>
</span></div>
<div><span><br>
</span></div>
<div><span></span></div>
</div>
<br>
<div>
<div dir="ltr">On Wed, Nov 3, 2021 at 10:50 AM Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div dir="ltr"><br>
</div>
<br>
<div>
<div dir="ltr">On Wed, Nov 3, 2021 at 10:34 AM Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>> wrote:<br>
</div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:rgb(0,0,255);margin:5pt" align="Left">
[AMD Official Use Only]<br>
</p>
<br>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi Alex,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Finally figured out the root cause for this broken,</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<pre>Linux 5.14.15  + afd1818 can fix the issue.</pre>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I'll do that for stable.<br>
</div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<pre>Linux 5.15rc7 re-apply "init iommu after amdkfd device init" and "move iommu_resume before ip init/resume" which overwrote afd1818 caused the issue again.

714d9e4 drm/amdgpu: init iommu after amdkfd device init

f02abeb drm/amdgpu: move iommu_resume before ip init/resume

afd1818 drm/amdkfd: fix boot failure when iommu is disabled in Picasso.

286826d drm/amdgpu: init iommu after amdkfd device init

9cec53c drm/amdgpu: move iommu_resume before ip init/resume</pre>
<img size="381936" style="max-width: 100%;" src="cid:17ce683eb31cb971f161"><br>
</div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773Signature">
<div>
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p style="margin-top:0px;margin-bottom:0px">So, do we just discard this patch, and revert 714d9e4 and  f02abeb?<br>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>I'll do that for 5.15+</div>
<div><br>
</div>
<div>Thanks for sorting this out.<br>
</div>
<div><br>
</div>
<div>Alex<br>
</div>
<div> </div>
<blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773Signature">
<div>
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p style="margin-top:0px;margin-bottom:0px"></p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">Thanks & Best Regards!</p>
<p style="margin-top:0px;margin-bottom:0px"><br>
</p>
<p style="margin-top:0px;margin-bottom:0px">James Zhu<br>
</p>
</div>
</div>
</div>
</div>
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773appendonsend"></div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_2067639188724892741x_gmail-m_7509508573591371901gmail-m_-4699608028220022773divRplyFwdMsg" dir="ltr">
<font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Alex Deucher <<a href="mailto:alexdeucher@gmail.com" target="_blank">alexdeucher@gmail.com</a>><br>
<b>Sent:</b> Tuesday, November 2, 2021 10:01 PM<br>
<b>To:</b> Zhu, James <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
<b>Cc:</b> amd-gfx list <<a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank">amd-gfx@lists.freedesktop.org</a>>; Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com" target="_blank">Alexander.Deucher@amd.com</a>>; Zhang, Yifan <<a href="mailto:Yifan1.Zhang@amd.com" target="_blank">Yifan1.Zhang@amd.com</a>>;
 James Zhu <<a href="mailto:jzhums@gmail.com" target="_blank">jzhums@gmail.com</a>>; Ken Moffat <<a href="mailto:zarniwhoop@ntlworld.com" target="_blank">zarniwhoop@ntlworld.com</a>><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: remove duplicated kfd_resume_iommu</font>
<div> </div>
</div>
<div><font size="2"><span style="font-size:11pt">
<div>On Tue, Nov 2, 2021 at 9:34 PM James Zhu <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>> wrote:<br>
><br>
> Remove duplicated kfd_resume_iommu which already runs<br>
> in mdgpu_amdkfd_device_init.<br>
><br>
> Signed-off-by: James Zhu <<a href="mailto:James.Zhu@amd.com" target="_blank">James.Zhu@amd.com</a>><br>
<br>
Once you get confirmation, please add:<br>
Bug: <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D214859&data=04%7C01%7CJames.Zhu%40amd.com%7C67f2c85612f7475d0dd008d99edb1fef%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637715486249968500%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=WhxYtNqFSoeWcuJSbJCCl99VSdd3XyHBVzjbpR3nx7g%3D&reserved=0" target="_blank">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.kernel.org%2Fshow_bug.cgi%3Fid%3D214859&amp;data=04%7C01%7CJames.Zhu%40amd.com%7C8662c25150e94d9d664708d99e6deb2b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637715017208277821%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=a6WyuNGhOU5OT3J8GQtXSQ3O5r942D2p%2BbruFUncT0E%3D&amp;reserved=0</a><br>
Bug: <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1770&data=04%7C01%7CJames.Zhu%40amd.com%7C67f2c85612f7475d0dd008d99edb1fef%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637715486249978500%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hX2U%2BcWp%2BEinTjxptnx0zExc%2Fy3lbFUYgHT2JDdUY0g%3D&reserved=0" target="_blank">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitlab.freedesktop.org%2Fdrm%2Famd%2F-%2Fissues%2F1770&amp;data=04%7C01%7CJames.Zhu%40amd.com%7C8662c25150e94d9d664708d99e6deb2b%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637715017208287813%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=E1MFXdprEaldLux2AoXNEeDWL5E85WFv8CrfZODTa%2F4%3D&amp;reserved=0</a><br>
<br>
Acked-by: Alex Deucher <<a href="mailto:alexander.deucher@amd.com" target="_blank">alexander.deucher@amd.com</a>><br>
<br>
<br>
> ---<br>
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----<br>
>  1 file changed, 4 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> index e56bc925afcf..f77823ce7ae8 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
> @@ -2398,10 +2398,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)<br>
>         if (!adev->gmc.xgmi.pending_reset)<br>
>                 amdgpu_amdkfd_device_init(adev);<br>
><br>
> -       r = amdgpu_amdkfd_resume_iommu(adev);<br>
> -       if (r)<br>
> -               goto init_failed;<br>
> -<br>
>         amdgpu_fru_get_product_info(adev);<br>
><br>
>  init_failed:<br>
> --<br>
> 2.25.1<br>
><br>
</div>
</span></font></div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>

</blockquote></div></div>