drm/amdgpu: init iommu after amdkfd device init
authorjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:28:06 +0000 (13:28 +0000)
committerjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:28:06 +0000 (13:28 +0000)
From Yifan Zhang
7508a9aa65b959bbc6d9e42c9683520bddb7db0d in linux 5.10.y/5.10.85
714d9e4574d54596973ee3b0624ee4a16264d700 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c

index 5eaad33..5070744 100644 (file)
@@ -2268,10 +2268,6 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
        if (r)
                goto init_failed;
 
-       r = amdgpu_amdkfd_resume_iommu(adev);
-       if (r)
-               goto init_failed;
-
        r = amdgpu_device_ip_hw_init_phase1(adev);
        if (r)
                goto init_failed;
@@ -2307,6 +2303,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)
                amdgpu_xgmi_add_device(adev);
        amdgpu_amdkfd_device_init(adev);
 
+       r = amdgpu_amdkfd_resume_iommu(adev);
+       if (r)
+               goto init_failed;
+
        amdgpu_fru_get_product_info(adev);
 
 init_failed: