Skip to contentSkip to conversation

drm/msm/adreno: Leave the GPU RSC awake for system poweroff

PATCH In review Michael Burch 2 participants 3 messages Oct 3 – Oct 22

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/msm/adreno: Leave the GPU RSC awake for system poweroff

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")
---
 drivers/gpu/drm/msm/adreno/a6xx_gmu.c      | 4 ++++
 drivers/gpu/drm/msm/adreno/adreno_device.c | 5 +++++
 2 files changed, 9 insertions(+)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +4 -0
index 6d49c51df1a2..42a96ff51e5e 100644
@@ -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);
 
drivers/gpu/drm/msm/adreno/adreno_device.c +5 -0
index 05c77fe27e62..224ab3fd14bd 100644
@@ -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

Signature · 1 line
2.55.0
#1 lore raw
Quoted 9 lines · Michael Burch

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.

Quoted 6 lines

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")

---

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

Konrad

#2 lore raw

No, testing included the sync state fix from here: https://lore.kernel.org/r/[email protected]

My mistake, belongs in a reply to that thread
________________________________
From: Konrad Dybcio <[email protected]>
Sent: Wednesday, October 21, 2026 7:12 AM
To: Michael Burch <[email protected]>; Rob Clark <[email protected]>; Akhil P Oommen <[email protected]>; Konrad Dybcio <[email protected]>; Dmitry Baryshkov <[email protected]>; Abhinav Kumar <[email protected]>; Jessica Zhang <[email protected]>; Sean Paul <[email protected]>; Marijn Suijten <[email protected]>
Cc: Shivam Rawat <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>; [email protected] <[email protected]>
Subject: Re: [PATCH] drm/msm/adreno: Leave the GPU RSC awake for system poweroff

Quoted 9 lines · Michael Burch

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.

Quoted 6 lines

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")

---

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

Konrad