drm/amdgpu: move iommu_resume before ip init/resume
authorjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:25:51 +0000 (13:25 +0000)
committerjsg <jsg@openbsd.org>
Tue, 14 Dec 2021 13:25:51 +0000 (13:25 +0000)
From James Zhu
ac9db04ee32f007e48cb0763784ccfadd5a21342 in linux 5.10.y/5.10.85
f02abeb0779700c308e661a412451b38962b8a0b in mainline linux

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

index 0334eb2..5eaad33 100644 (file)
@@ -2268,6 +2268,10 @@ 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;
@@ -2961,6 +2965,10 @@ static int amdgpu_device_ip_resume(struct amdgpu_device *adev)
 {
        int r;
 
+       r = amdgpu_amdkfd_resume_iommu(adev);
+       if (r)
+               return r;
+
        r = amdgpu_device_ip_resume_phase1(adev);
        if (r)
                return r;
@@ -4401,6 +4409,10 @@ static int amdgpu_do_asic_reset(struct amdgpu_hive_info *hive,
 
                        if (!r) {
                                dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n");
+                               r = amdgpu_amdkfd_resume_iommu(tmp_adev);
+                               if (r)
+                                       goto out;
+
                                r = amdgpu_device_ip_resume_phase1(tmp_adev);
                                if (r)
                                        goto out;