All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rajib Mahapatra <rajib.mahapatra@amd.com>
To: <Prike.Liang@amd.com>, <Mario.Limonciello@amd.com>,
	Alex Deucher <alexander.deucher@amd.com>
Cc: Rajib Mahapatra <rajib.mahapatra@amd.com>,
	amd-gfx@lists.freedesktop.org, shirish.s@amd.com
Subject: [PATCH v2] drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix.
Date: Thu, 10 Feb 2022 19:05:07 +0530	[thread overview]
Message-ID: <20220210133507.5954-1-rajib.mahapatra@amd.com> (raw)

[Why]
SDMA ring buffer test failed if suspend is aborted during
S0i3 resume.

[How]
If suspend is aborted for some reason during S0i3 resume
cycle, it follows SDMA ring test failing and errors in amdgpu
resume. For RN/CZN/Picasso, SMU saves and restores SDMA
registers during S0ix cycle. So, skipping SDMA suspend and
resume from driver solves the issue. This time, the system
is able to resume gracefully even the suspend is aborted.

v2: add changes on sdma_v4, skipping SDMA hw_init and hw_fini.
Signed-off-by: Rajib Mahapatra <rajib.mahapatra@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
index 06a7ceda4c87..02115d63b071 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
@@ -2058,6 +2058,10 @@ static int sdma_v4_0_suspend(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	/* SMU saves SDMA state for us */
+	if (adev->in_s0ix)
+		return 0;
+
 	return sdma_v4_0_hw_fini(adev);
 }
 
@@ -2065,6 +2069,10 @@ static int sdma_v4_0_resume(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+	/* SMU restores SDMA state for us */
+	if (adev->in_s0ix)
+		return 0;
+
 	return sdma_v4_0_hw_init(adev);
 }
 
-- 
2.25.1


             reply	other threads:[~2022-02-10 13:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 13:35 Rajib Mahapatra [this message]
2022-02-10 14:04 ` [PATCH v2] drm/amdgpu: skipping SDMA hw_init and hw_fini for S0ix Limonciello, Mario
2022-02-10 15:28   ` Alex Deucher
2022-02-10 15:42     ` Limonciello, Mario
2022-02-10 15:47       ` Alex Deucher
2022-02-10 16:08         ` Limonciello, Mario
2022-02-10 16:10           ` Alex Deucher
2022-02-11  6:26           ` Liang, Prike

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=20220210133507.5954-1-rajib.mahapatra@amd.com \
    --to=rajib.mahapatra@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=shirish.s@amd.com \
    /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.