AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: clear in_runpm when runtime suspend fails in prepare
@ 2026-12-01 14:14 James Zhu
  2026-12-01 14:14 ` [PATCH 2/3] drm/amdkfd: rebuild CWSR TBA/TMA in VRAM after system resume James Zhu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: James Zhu @ 2026-12-01 14:14 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, philip.yang, Harish.Kasiviswanathan,
	vladimir.indic, jamesz, Heng.Zhou

amdgpu_pmops_runtime_suspend() sets in_runpm and, on BOCO, mp1_state
before it calls amdgpu_device_prepare(). When prepare fails it returns
without undoing either, unlike the amdgpu_device_suspend() failure just
below. The device stays active with in_runpm set, so later checks of
in_runpm, including the ones made during system suspend and resume, take
the runtime PM path. The next patch relies on in_runpm to tell a system
resume from a runtime resume.

Handle both failures the same way.

Fixes: 5095d5418193 ("drm/amd: Evict resources during PM ops prepare() callback")
Signed-off-by: James Zhu <James.Zhu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 2a8614269984..7418c8588e18 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -2917,9 +2917,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
 		adev->mp1_state = PP_MP1_STATE_UNLOAD;
 
 	ret = amdgpu_device_prepare(drm_dev);
-	if (ret)
-		return ret;
-	ret = amdgpu_device_suspend(drm_dev, false);
+	if (!ret)
+		ret = amdgpu_device_suspend(drm_dev, false);
 	if (ret) {
 		adev->in_runpm = false;
 		if (adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO)
-- 
2.56.1


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

end of thread, other threads:[~2026-12-01 14:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 14:14 [PATCH 1/3] drm/amdgpu: clear in_runpm when runtime suspend fails in prepare James Zhu
2026-12-01 14:14 ` [PATCH 2/3] drm/amdkfd: rebuild CWSR TBA/TMA in VRAM after system resume James Zhu
2026-12-01 14:15 ` [PATCH 3/3] Revert "drm/amdkfd: move TBA/TMA back to system memory" James Zhu
2026-12-01 14:37   ` sashiko-bot
2026-12-01 14:28 ` [PATCH 1/3] drm/amdgpu: clear in_runpm when runtime suspend fails in prepare sashiko-bot

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