From: jsg Date: Tue, 14 Dec 2021 13:25:51 +0000 (+0000) Subject: drm/amdgpu: move iommu_resume before ip init/resume X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e7ede0e67a68305164534e2f894c0270b9d041c5;p=openbsd drm/amdgpu: move iommu_resume before ip init/resume From James Zhu ac9db04ee32f007e48cb0763784ccfadd5a21342 in linux 5.10.y/5.10.85 f02abeb0779700c308e661a412451b38962b8a0b in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c index 0334eb20800..5eaad334878 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c @@ -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;