mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/msm/adreno: Leave the GPU RSC awake for system poweroff
@ 2026-10-03 19:35 Michael Burch
  2026-10-21 12:12 ` Konrad Dybcio
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Burch @ 2026-10-03 19:35 UTC (permalink / raw)
  To: Rob Clark, Akhil P Oommen, Konrad Dybcio, Dmitry Baryshkov,
	Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten
  Cc: Shivam Rawat, linux-arm-msm, dri-devel, freedreno, linux-kernel

On X1E80100 (Dell XPS 13 9345), commit d9108bfdb746 ("drm/msm/a6xx: Fix
stale rpmh votes after suspend") appears to turn poweroff into a reboot.
It seems to happen when the GPU RSC/PDC is asleep at system off, i.e.
when the GPU was idle before shutdown. Keeping the GPU awake until
shutdown avoids it.

Resume the GPU in adreno_shutdown() and skip the RSC sleep in the final
stop. Suspend and runtime suspend are unchanged.

Tested on X1E80100 only: poweroff and reboot on AC and battery, and
deep suspend still drops the GPU votes.

Fixes: d9108bfdb746 ("drm/msm/a6xx: Fix stale rpmh votes after suspend")
Signed-off-by: Michael Burch <me@michaelburch.net>
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c      | 4 ++++
 drivers/gpu/drm/msm/adreno/adreno_device.c | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
index 6d49c51df1a2..42a96ff51e5e 100644
--- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
+++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
@@ -645,6 +645,10 @@ static void a6xx_rpmh_stop(struct a6xx_gmu *gmu)
 	if (!test_and_clear_bit(GMU_STATUS_FW_START, &gmu->status))
 		return;
 
+	/* Some platforms reboot instead of powering off if the GPU PDC is asleep */
+	if (system_state == SYSTEM_POWER_OFF || system_state == SYSTEM_HALT)
+		return;
+
 	if (adreno_is_a840(adreno_gpu))
 		bitmask = BIT(30);
 
diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index 05c77fe27e62..224ab3fd14bd 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -290,6 +290,11 @@ static void adreno_remove(struct platform_device *pdev)
 
 static void adreno_shutdown(struct platform_device *pdev)
 {
+	/* Resuming wakes the GMU RSC/PDC; the final stop then leaves it awake */
+	if (dev_to_gpu(&pdev->dev) &&
+	    (system_state == SYSTEM_POWER_OFF || system_state == SYSTEM_HALT))
+		pm_runtime_get_sync(&pdev->dev);
+
 	WARN_ON_ONCE(adreno_system_suspend(&pdev->dev));
 }
 

base-commit: 3f2425f5b5bbbdd991ca9cdfd5502e68d8895998
-- 
2.55.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/msm/adreno: Leave the GPU RSC awake for system poweroff
  2026-10-03 19:35 [PATCH] drm/msm/adreno: Leave the GPU RSC awake for system poweroff Michael Burch
@ 2026-10-21 12:12 ` Konrad Dybcio
  0 siblings, 0 replies; 2+ messages in thread
From: Konrad Dybcio @ 2026-10-21 12:12 UTC (permalink / raw)
  To: Michael Burch, Rob Clark, Akhil P Oommen, Konrad Dybcio,
	Dmitry Baryshkov, Abhinav Kumar, Jessica Zhang, Sean Paul,
	Marijn Suijten
  Cc: Shivam Rawat, linux-arm-msm, dri-devel, freedreno, linux-kernel

On 10/3/26 9:35 PM, Michael Burch wrote:
> On X1E80100 (Dell XPS 13 9345), commit d9108bfdb746 ("drm/msm/a6xx: Fix
> stale rpmh votes after suspend") appears to turn poweroff into a reboot.
> It seems to happen when the GPU RSC/PDC is asleep at system off, i.e.
> when the GPU was idle before shutdown. Keeping the GPU awake until
> shutdown avoids it.
> 
> Resume the GPU in adreno_shutdown() and skip the RSC sleep in the final
> stop. Suspend and runtime suspend are unchanged.
> 
> Tested on X1E80100 only: poweroff and reboot on AC and battery, and
> deep suspend still drops the GPU votes.
> 
> Fixes: d9108bfdb746 ("drm/msm/a6xx: Fix stale rpmh votes after suspend")
> Signed-off-by: Michael Burch <me@michaelburch.net>
> ---

This is odd - did you test it precisely with and without this patch
and no other changes?

Konrad

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-21 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-03 19:35 [PATCH] drm/msm/adreno: Leave the GPU RSC awake for system poweroff Michael Burch
2026-10-21 12:12 ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®