From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Prike Liang <Prike.Liang@amd.com>,
Alex Deucher <alexander.deucher@amd.com>,
Sasha Levin <sashal@kernel.org>,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, Hawking.Zhang@amd.com, lijo.lazar@amd.com,
le.ma@amd.com, James.Zhu@amd.com, shane.xiao@amd.com,
sonny.jiang@amd.com, amd-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.7 16/23] drm/amdgpu: Enable gpu reset for S3 abort cases on Raven series
Date: Mon, 11 Mar 2024 11:11:56 -0400 [thread overview]
Message-ID: <20240311151217.317068-16-sashal@kernel.org> (raw)
In-Reply-To: <20240311151217.317068-1-sashal@kernel.org>
From: Prike Liang <Prike.Liang@amd.com>
[ Upstream commit c671ec01311b4744b377f98b0b4c6d033fe569b3 ]
Currently, GPU resets can now be performed successfully on the Raven
series. While GPU reset is required for the S3 suspend abort case.
So now can enable gpu reset for S3 abort cases on the Raven series.
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/soc15.c | 45 +++++++++++++++++-------------
1 file changed, 25 insertions(+), 20 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index 9b5af3f1383a7..f9ba1803046d9 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -574,11 +574,34 @@ soc15_asic_reset_method(struct amdgpu_device *adev)
return AMD_RESET_METHOD_MODE1;
}
+static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
+{
+ u32 sol_reg;
+
+ sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
+
+ /* Will reset for the following suspend abort cases.
+ * 1) Only reset limit on APU side, dGPU hasn't checked yet.
+ * 2) S3 suspend abort and TOS already launched.
+ */
+ if (adev->flags & AMD_IS_APU && adev->in_s3 &&
+ !adev->suspend_complete &&
+ sol_reg)
+ return true;
+
+ return false;
+}
+
static int soc15_asic_reset(struct amdgpu_device *adev)
{
/* original raven doesn't have full asic reset */
- if ((adev->apu_flags & AMD_APU_IS_RAVEN) ||
- (adev->apu_flags & AMD_APU_IS_RAVEN2))
+ /* On the latest Raven, the GPU reset can be performed
+ * successfully. So now, temporarily enable it for the
+ * S3 suspend abort case.
+ */
+ if (((adev->apu_flags & AMD_APU_IS_RAVEN) ||
+ (adev->apu_flags & AMD_APU_IS_RAVEN2)) &&
+ !soc15_need_reset_on_resume(adev))
return 0;
switch (soc15_asic_reset_method(adev)) {
@@ -1297,24 +1320,6 @@ static int soc15_common_suspend(void *handle)
return soc15_common_hw_fini(adev);
}
-static bool soc15_need_reset_on_resume(struct amdgpu_device *adev)
-{
- u32 sol_reg;
-
- sol_reg = RREG32_SOC15(MP0, 0, mmMP0_SMN_C2PMSG_81);
-
- /* Will reset for the following suspend abort cases.
- * 1) Only reset limit on APU side, dGPU hasn't checked yet.
- * 2) S3 suspend abort and TOS already launched.
- */
- if (adev->flags & AMD_IS_APU && adev->in_s3 &&
- !adev->suspend_complete &&
- sol_reg)
- return true;
-
- return false;
-}
-
static int soc15_common_resume(void *handle)
{
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
--
2.43.0
next prev parent reply other threads:[~2024-03-11 15:12 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-11 15:11 [PATCH AUTOSEL 6.7 01/23] regulator: max5970: Fix regulator child node name Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 02/23] wifi: iwlwifi: mvm: ensure offloading TID queue exists Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 03/23] wifi: iwlwifi: mvm: fix the TXF mapping for BZ devices Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 04/23] btrfs: zoned: don't skip block group profile checks on conventional zones Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 05/23] btrfs: fix data races when accessing the reserved amount of block reserves Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 06/23] btrfs: fix data race at btrfs_use_block_rsv() when accessing block reserve Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 07/23] spi: cadence-qspi: put runtime in runtime PM hooks names Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 08/23] spi: cadence-qspi: add system-wide suspend and resume callbacks Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 09/23] net: smsc95xx: add support for SYS TEC USB-SPEmodule1 Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 10/23] wifi: mac80211: only call drv_sta_rc_update for uploaded stations Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 11/23] drm/ttm/tests: depend on UML || COMPILE_TEST Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 12/23] ASoC: amd: yc: Add Lenovo ThinkBook 21J0 into DMI quirk table Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 13/23] scsi: mpt3sas: Prevent sending diag_reset when the controller is ready Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 14/23] selftests: mptcp: explicitly trigger the listener diag code-path Sasha Levin
2024-03-11 15:28 ` Matthieu Baerts
2024-03-18 12:47 ` Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 15/23] ALSA: hda/realtek - ALC285 reduce pop noise from Headphone port Sasha Levin
2024-03-11 15:11 ` Sasha Levin [this message]
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 17/23] drm/buddy: check range allocation matches alignment Sasha Levin
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 18/23] ASoC: amd: yc: add new YC platform variant (0x63) support Sasha Levin
2024-03-11 15:39 ` Mukunda,Vijendar
2024-03-11 15:43 ` Mark Brown
2024-03-11 15:48 ` Mukunda,Vijendar
2024-03-11 15:11 ` [PATCH AUTOSEL 6.7 19/23] ASoC: amd: yc: Fix non-functional mic on Lenovo 21J2 Sasha Levin
2024-03-11 15:12 ` [PATCH AUTOSEL 6.7 20/23] Bluetooth: rfcomm: Fix null-ptr-deref in rfcomm_check_security Sasha Levin
2024-03-11 15:12 ` [PATCH AUTOSEL 6.7 21/23] Bluetooth: mgmt: Fix limited discoverable off timeout Sasha Levin
2024-03-11 15:12 ` [PATCH AUTOSEL 6.7 22/23] firewire: core: use long bus reset on gap count error Sasha Levin
2024-03-11 15:12 ` [PATCH AUTOSEL 6.7 23/23] perf: RISCV: Fix panic on pmu overflow handler Sasha Levin
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=20240311151217.317068-16-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=Hawking.Zhang@amd.com \
--cc=James.Zhu@amd.com \
--cc=Prike.Liang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=le.ma@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shane.xiao@amd.com \
--cc=sonny.jiang@amd.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox