public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error
@ 2023-03-29 14:04 Konrad Dybcio
  2023-03-29 14:37 ` Johan Hovold
  0 siblings, 1 reply; 9+ messages in thread
From: Konrad Dybcio @ 2023-03-29 14:04 UTC (permalink / raw)
  To: linux-arm-msm, andersson, agross
  Cc: marijn.suijten, Konrad Dybcio, Rob Clark, Abhinav Kumar,
	Dmitry Baryshkov, Sean Paul, David Airlie, Daniel Vetter,
	Johan Hovold, Akhil P Oommen, Joel Fernandes (Google),
	Nathan Chancellor, dri-devel, freedreno, linux-kernel

If we fail to initialize the GPU for whatever reason (say we don't
embed the GPU firmware files in the initrd), the error path involves
pm_runtime_put_sync() which then calls idle() instead of suspend().

This is suboptimal, as it means that we're not going through the
clean shutdown sequence. With at least A619_holi, this makes the GPU
not wake up until it goes through at least one more start-fail-stop
cycle. Fix that by using pm_runtime_put_sync_suspend to force a clean
shutdown.

Test cases:
1. firmware baked into kernel
2. error loading fw in initrd -> load from rootfs at DE start

Both succeed on A619_holi (SM6375) and A630 (SDM845).

Fixes: 0d997f95b70f ("drm/msm/adreno: fix runtime PM imbalance at gpu load")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
 drivers/gpu/drm/msm/adreno/adreno_device.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c
index f61896629be6..59f3302e8167 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
@@ -477,7 +477,7 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)
 	return gpu;
 
 err_put_rpm:
-	pm_runtime_put_sync(&pdev->dev);
+	pm_runtime_put_sync_suspend(&pdev->dev);
 err_disable_rpm:
 	pm_runtime_disable(&pdev->dev);
 
-- 
2.40.0


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

end of thread, other threads:[~2023-03-30 14:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 14:04 [PATCH] drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error Konrad Dybcio
2023-03-29 14:37 ` Johan Hovold
2023-03-29 15:48   ` Konrad Dybcio
2023-03-29 17:30     ` Rob Clark
2023-03-29 17:31       ` Konrad Dybcio
2023-03-29 19:45     ` Dmitry Baryshkov
2023-03-30 14:34       ` Konrad Dybcio
2023-03-30 14:52         ` Dmitry Baryshkov
2023-03-30 14:49       ` Johan Hovold

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