]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 06:36:16 +0000 (08:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 May 2023 06:36:16 +0000 (08:36 +0200)
added patches:
drm-msm-adreno-adreno_gpu-use-suspend-instead-of-idle-on-load-error.patch

queue-5.15/drm-msm-adreno-adreno_gpu-use-suspend-instead-of-idle-on-load-error.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/drm-msm-adreno-adreno_gpu-use-suspend-instead-of-idle-on-load-error.patch b/queue-5.15/drm-msm-adreno-adreno_gpu-use-suspend-instead-of-idle-on-load-error.patch
new file mode 100644 (file)
index 0000000..ee11311
--- /dev/null
@@ -0,0 +1,58 @@
+From 3eeca5e5f3100435b06a5b5d86daa3d135a8a4bd Mon Sep 17 00:00:00 2001
+From: Konrad Dybcio <konrad.dybcio@linaro.org>
+Date: Fri, 31 Mar 2023 01:15:16 +0200
+Subject: drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error
+
+From: Konrad Dybcio <konrad.dybcio@linaro.org>
+
+commit 3eeca5e5f3100435b06a5b5d86daa3d135a8a4bd upstream.
+
+The adreno_load_gpu() path is guarded by an error check on
+adreno_load_fw(). This function is responsible for loading
+Qualcomm-only-signed binaries (e.g. SQE and GMU FW for A6XX), but it
+does not take the vendor-signed ZAP blob into account.
+
+By embedding the SQE (and GMU, if necessary) firmware into the
+initrd/kernel, we can trigger and unfortunate path that would not bail
+out early and proceed with gpu->hw_init(). That will fail, as the ZAP
+loader path will not find the firmware and return back to
+adreno_load_gpu().
+
+This 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. The pm_runtime_put_sync that appears in the error
+path actually does not guarantee that because of the earlier enabling of
+runtime autosuspend.
+
+Fix that by using pm_runtime_put_sync_suspend to force a clean shutdown.
+
+Test cases:
+1. All firmware baked into kernel
+2. error loading ZAP 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>
+Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
+Patchwork: https://patchwork.freedesktop.org/patch/530001/
+Link: https://lore.kernel.org/r/20230330231517.2747024-1-konrad.dybcio@linaro.org
+Signed-off-by: Rob Clark <robdclark@chromium.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/msm/adreno/adreno_device.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/msm/adreno/adreno_device.c
++++ b/drivers/gpu/drm/msm/adreno/adreno_device.c
+@@ -431,7 +431,7 @@ struct msm_gpu *adreno_load_gpu(struct d
+       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);
index 733896dab611b0d169c70d0a6aa8cf67f181da4b..bc2d905454d8b8a1b3b5790a02109e7b974ed72e 100644 (file)
@@ -127,3 +127,4 @@ ext4-add-bounds-checking-in-get_max_inline_xattr_value_size.patch
 ext4-bail-out-of-ext4_xattr_ibody_get-fails-for-any-reason.patch
 ext4-remove-a-bug_on-in-ext4_mb_release_group_pa.patch
 ext4-fix-invalid-free-tracking-in-ext4_xattr_move_to_block.patch
+drm-msm-adreno-adreno_gpu-use-suspend-instead-of-idle-on-load-error.patch