drm/amdkfd: fix boot failure when iommu is disabled in Picasso.
authorYifan Zhang <yifan1.zhang@amd.com>
Mon, 11 Oct 2021 12:37:01 +0000 (20:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 6 Nov 2021 13:13:30 +0000 (14:13 +0100)
commit afd18180c07026f94a80ff024acef5f4159084a4 upstream.

When IOMMU disabled in sbios and kfd in iommuv2 path, iommuv2
init will fail. But this failure should not block amdgpu driver init.

Reported-by: youling <youling257@gmail.com>
Tested-by: youling <youling257@gmail.com>
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdkfd/kfd_device.c

index af9bdf16eefd48761fdd9e1ce24627d0c3e083e4..9dfcef2015c8b2a5e23a901a0791133fb18be97b 100644 (file)
@@ -2432,10 +2432,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
        if (!adev->gmc.xgmi.pending_reset)
                amdgpu_amdkfd_device_init(adev);
 
-       r = amdgpu_amdkfd_resume_iommu(adev);
-       if (r)
-               goto init_failed;
-
        amdgpu_fru_get_product_info(adev);
 
 init_failed:
index 4a416231b24c8b42a1269227c5e7789702f9016e..a6afacc3b10cdf1638604fa1850318de280e403b 100644 (file)
@@ -924,6 +924,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 
        svm_migrate_init((struct amdgpu_device *)kfd->kgd);
 
+       if(kgd2kfd_resume_iommu(kfd))
+               goto device_iommu_error;
+
        if (kfd_resume(kfd))
                goto kfd_resume_error;