mirror-linux/drivers/gpu/drm/msm/adreno
Konrad Dybcio 3eeca5e5f3 drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error
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: 0d997f95b7 ("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>
2023-04-03 07:40:04 -07:00
..
a2xx.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a2xx_gpu.c drm/msm/a2xx: support loading legacy (iMX) firmware 2023-01-16 10:34:43 -08:00
a2xx_gpu.h drm/msm/a2xx: support loading legacy (iMX) firmware 2023-01-16 10:34:43 -08:00
a3xx.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a3xx_gpu.c drm/msm/a3xx: Implement .gpu_busy 2023-03-20 11:04:59 -07:00
a3xx_gpu.h
a4xx.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a4xx_gpu.c drm/msm/a4xx: Implement .gpu_busy 2023-03-20 11:04:59 -07:00
a4xx_gpu.h
a5xx.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a5xx_debugfs.c drm/msm: Remove struct_mutex usage 2021-11-28 09:50:33 -08:00
a5xx_gpu.c drm/msm/a5xx: add devcoredump support to the fault handler 2023-03-30 09:42:05 -07:00
a5xx_gpu.h drm/msm: Allow a5xx to mark the RPTR shadow as privileged 2020-09-15 10:47:44 -07:00
a5xx_power.c drm/msm: drop drm_gem_object_put_locked() 2021-07-27 18:09:18 -07:00
a5xx_preempt.c drm/msm/a5xx: fix context faults during ring switch 2023-02-22 11:22:03 -08:00
a6xx.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a6xx_gmu.c drm/msm/a6xx: Move ioremap out of hw_init path 2023-03-25 16:31:45 -07:00
a6xx_gmu.h drm/msm/a6xx: Use genpd notifier to ensure cx-gdsc collapse 2023-03-20 10:54:22 -07:00
a6xx_gmu.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a6xx_gpu.c drm/msm/a6xx: Add support for A650 speed binning 2023-03-31 10:32:24 -07:00
a6xx_gpu.h drm/msm/a6xx: Avoid gx gbit halt during rpm suspend 2023-01-05 15:13:16 -08:00
a6xx_gpu_state.c drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
a6xx_gpu_state.h drm/msm/a6xx: Update ROQ size in coredump 2023-01-16 10:35:51 -08:00
a6xx_hfi.c drm/msm/adreno: Add A619 support 2022-07-06 08:41:19 -07:00
a6xx_hfi.h drm/msm/gpu: Also snapshot GMU HFI buffer 2021-11-29 16:19:58 -08:00
adreno_common.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00
adreno_device.c drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error 2023-04-03 07:40:04 -07:00
adreno_gpu.c drm/msm/adreno: adreno_gpu: Don't set OPP scaling clock w/ GMU 2023-04-03 07:38:54 -07:00
adreno_gpu.h drm/msm/adreno: split a6xx fault handler into generic and a6xx parts 2023-03-28 15:49:09 -07:00
adreno_pm4.xml.h drm/msm: Update generated headers 2023-03-21 09:10:47 -07:00