archive mirror
 help / color / mirror / Atom feed
From: Felix Kuehling <>
To: <>
Cc: Vasant Hegde <>,
	Linux regression tracking <>,
Subject: [PATCH] drm/amdgpu: Don't resume IOMMU after incomplete init
Date: Tue, 14 Mar 2023 13:53:59 -0400	[thread overview]
Message-ID: <> (raw)

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.

Cc: Vasant Hegde <>
Cc: Linux regression tracking (Thorsten Leemhuis) <>
Signed-off-by: Felix Kuehling <>
 drivers/gpu/drm/amd/amdkfd/kfd_device.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 521dfa88aad8..989c6aa2620b 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -60,6 +60,7 @@ static int kfd_gtt_sa_init(struct kfd_dev *kfd, unsigned int buf_size,
 				unsigned int chunk_size);
 static void kfd_gtt_sa_fini(struct kfd_dev *kfd);
+static int kfd_resume_iommu(struct kfd_dev *kfd);
 static int kfd_resume(struct kfd_dev *kfd);
 static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd)
@@ -625,7 +626,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
-	if (kgd2kfd_resume_iommu(kfd))
+	if (kfd_resume_iommu(kfd))
 		goto device_iommu_error;
 	if (kfd_resume(kfd))
@@ -773,6 +774,14 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
 int kgd2kfd_resume_iommu(struct kfd_dev *kfd)
+	if (!kfd->init_complete)
+		return 0;
+	return kfd_resume_iommu(kfd);
+static int kfd_resume_iommu(struct kfd_dev *kfd)
 	int err = 0;

             reply	other threads:[~2023-03-14 17:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 17:53 Felix Kuehling [this message]
2023-03-14 18:12 ` [PATCH] drm/amdgpu: Don't resume IOMMU after incomplete init Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).