<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0000FF;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);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>From:</b> Zhang, Yifan <Yifan1.Zhang@amd.com><br>
<b>Sent:</b> Monday, October 11, 2021 8:57 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kuehling, Felix <Felix.Kuehling@amd.com>; Zhu, James <James.Zhu@amd.com>; youling257@gmail.com <youling257@gmail.com>; Zhang, Yifan <Yifan1.Zhang@amd.com><br>
<b>Subject:</b> [PATCH 1/2] drm/amdkfd: fix boot failure when iommu is disabled in Picasso.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2<br>
init will fail. But this failure should not block amdgpu driver init.<br>
<br>
Reported-by: youling <youling257@gmail.com><br>
Tested-by: youling <youling257@gmail.com><br>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ----<br>
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 3 +++<br>
 2 files changed, 3 insertions(+), 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 af9bdf16eefd..9dfcef2015c8 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<br>
@@ -2432,10 +2432,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>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
index 4a416231b24c..bb652ee35c25 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c<br>
@@ -920,6 +920,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,<br>
                 goto device_iommu_error;<br>
         }<br>
 <br>
+       if(kgd2kfd_resume_iommu(kfd))<br>
+               goto device_iommu_error;<br>
+<br>
         kfd_cwsr_init(kfd);<br>
 <br>
         svm_migrate_init((struct amdgpu_device *)kfd->kgd);</div>
<div class="PlainText">[JZ] Move the above change to here, the device init sequence will be closer to initial design.<br>
</div>
<div class="PlainText">-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>