From: jsg Date: Tue, 14 Dec 2021 13:29:50 +0000 (+0000) Subject: drm/amdkfd: fix boot failure when iommu is disabled in Picasso. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0bd58960fc37bea64cc7e050a29074512c3acd3e;p=openbsd drm/amdkfd: fix boot failure when iommu is disabled in Picasso. From Yifan Zhang f3d9114ac99f4358809f44b390b304b8b53fb4a4 in linux 5.10.y/5.10.85 afd18180c07026f94a80ff024acef5f4159084a4 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 50707448cc7..eaeb9c7dc30 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c @@ -2303,10 +2303,6 @@ 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: diff --git a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c index 1204dae8579..84313135c2e 100644 --- a/sys/dev/pci/drm/amd/amdkfd/kfd_device.c +++ b/sys/dev/pci/drm/amd/amdkfd/kfd_device.c @@ -751,6 +751,9 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, kfd_cwsr_init(kfd); + if(kgd2kfd_resume_iommu(kfd)) + goto device_iommu_error; + if (kfd_resume(kfd)) goto kfd_resume_error;