All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Zhu <James.Zhu@amd.com>
To: <stable@vger.kernel.org>
Cc: <jzhums@gmail.com>, <alexander.deucher@amd.com>,
	<kolAflash@kolahilft.de>, Felix Kuehling <Felix.Kuehling@amd.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: [PATCH 2/6] drm/amdkfd: separate kfd_iommu_resume from kfd_resume
Date: Thu, 9 Dec 2021 17:09:52 -0500	[thread overview]
Message-ID: <20211209220956.3466442-3-James.Zhu@amd.com> (raw)
In-Reply-To: <20211209220956.3466442-1-James.Zhu@amd.com>

commit fefc01f042f44ede373ee66773b8238dd8fdcb55 upstream.

Separate kfd_iommu_resume from kfd_resume for fine-tuning
of amdgpu device init/resume/reset/recovery sequence.

v2: squash in fix for !CONFIG_HSA_AMD

Bug: https://bugzilla.kernel.org/show_bug.cgi?id=211277
Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: James Zhu <James.Zhu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h |  6 ++++++
 drivers/gpu/drm/amd/amdkfd/kfd_device.c    | 12 ++++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
index a81d9cacf9b8..8a402a3df412 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h
@@ -305,6 +305,7 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
 			 const struct kgd2kfd_shared_resources *gpu_resources);
 void kgd2kfd_device_exit(struct kfd_dev *kfd);
 void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm);
+int kgd2kfd_resume_iommu(struct kfd_dev *kfd);
 int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm);
 int kgd2kfd_pre_reset(struct kfd_dev *kfd);
 int kgd2kfd_post_reset(struct kfd_dev *kfd);
@@ -343,6 +344,11 @@ static inline void kgd2kfd_suspend(struct kfd_dev *kfd, bool run_pm)
 {
 }
 
+static int __maybe_unused kgd2kfd_resume_iommu(struct kfd_dev *kfd)
+{
+	return 0;
+}
+
 static inline int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
 {
 	return 0;
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 5751bddc9cad..1204dae85797 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -896,17 +896,21 @@ int kgd2kfd_resume(struct kfd_dev *kfd, bool run_pm)
 	return ret;
 }
 
-static int kfd_resume(struct kfd_dev *kfd)
+int kgd2kfd_resume_iommu(struct kfd_dev *kfd)
 {
 	int err = 0;
 
 	err = kfd_iommu_resume(kfd);
-	if (err) {
+	if (err)
 		dev_err(kfd_device,
 			"Failed to resume IOMMU for device %x:%x\n",
 			kfd->pdev->vendor, kfd->pdev->device);
-		return err;
-	}
+	return err;
+}
+
+static int kfd_resume(struct kfd_dev *kfd)
+{
+	int err = 0;
 
 	err = kfd->dqm->ops.start(kfd->dqm);
 	if (err) {
-- 
2.25.1


  parent reply	other threads:[~2021-12-09 22:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 22:09 [PATCH 0/6] Bug:211277 fix backport for 5.10 stable James Zhu
2021-12-09 22:09 ` [PATCH 1/6] drm/amd/amdkfd: adjust dummy functions' placement James Zhu
2021-12-09 22:09 ` James Zhu [this message]
2021-12-09 22:09 ` [PATCH 3/6] drm/amdgpu: add amdgpu_amdkfd_resume_iommu James Zhu
2021-12-09 22:09 ` [PATCH 4/6] drm/amdgpu: move iommu_resume before ip init/resume James Zhu
2021-12-09 22:09 ` [PATCH 5/6] drm/amdgpu: init iommu after amdkfd device init James Zhu
2021-12-09 22:09 ` [PATCH 6/6] drm/amdkfd: fix boot failure when iommu is disabled in Picasso James Zhu
2021-12-10 13:33   ` Greg Kroah-Hartman
2021-12-10 14:14     ` James Zhu
2021-12-10 14:35       ` Greg Kroah-Hartman
2021-12-10 14:46         ` James Zhu
2021-12-10 15:12           ` Greg Kroah-Hartman
2021-12-10 15:33             ` James Zhu
2021-12-10  6:33 ` [PATCH 0/6] Bug:211277 fix backport for 5.10 stable Greg KH

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20211209220956.3466442-3-James.Zhu@amd.com \
    --to=james.zhu@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jzhums@gmail.com \
    --cc=kolAflash@kolahilft.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.