Skip to content

Commit f3921a9

Browse files
fxkamdalexdeucher
authored andcommitted
drm/amdgpu: Don't resume IOMMU after incomplete init
Check kfd->init_complete in kgd2kfd_iommu_resume, consistent with other kgd2kfd calls. This should fix IOMMU errors on resume from suspend when KFD IOMMU initialization failed. Reported-by: Matt Fagnani <[email protected]> Link: https://lore.kernel.org/r/[email protected]/ Link: https://bugzilla.kernel.org/show_bug.cgi?id=217170 Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2454 Cc: Vasant Hegde <[email protected]> Cc: Linux regression tracking (Thorsten Leemhuis) <[email protected]> Cc: [email protected] Signed-off-by: Felix Kuehling <[email protected]> Acked-by: Alex Deucher <[email protected]> Tested-by: Matt Fagnani <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 20bc9f7 commit f3921a9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/gpu/drm/amd/amdkfd/kfd_device.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size,
5959
unsigned int chunk_size);
6060
static void kfd_gtt_sa_fini(struct kfd_dev *kfd);
6161

62+
static int kfd_resume_iommu(struct kfd_dev *kfd);
6263
static int kfd_resume(struct kfd_dev *kfd);
6364

6465
static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd)
@@ -624,7 +625,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
624625

625626
svm_migrate_init(kfd->adev);
626627

627-
if (kgd2kfd_resume_iommu(kfd))
628+
if (kfd_resume_iommu(kfd))
628629
goto device_iommu_error;
629630

630631
if (kfd_resume(kfd))
@@ -772,6 +773,14 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
772773
}
773774

774775
int kgd2kfd_resume_iommu(struct kfd_dev *kfd)
776+
{
777+
if (!kfd->init_complete)
778+
return 0;
779+
780+
return kfd_resume_iommu(kfd);
781+
}
782+
783+
static int kfd_resume_iommu(struct kfd_dev *kfd)
775784
{
776785
int err = 0;
777786

0 commit comments

Comments
 (0)