kernel_samsung_a53x/drivers/gpu/drm/msm
Vladimir Lypak 22746ff9a0 drm/msm/a5xx: fix races in preemption evaluation stage
[ Upstream commit ce050f307ad93bcc5958d0dd35fc276fd394d274 ]

On A5XX GPUs when preemption is used it's invietable to enter a soft
lock-up state in which GPU is stuck at empty ring-buffer doing nothing.
This appears as full UI lockup and not detected as GPU hang (because
it's not). This happens due to not triggering preemption when it was
needed. Sometimes this state can be recovered by some new submit but
generally it won't happen because applications are waiting for old
submits to retire.

One of the reasons why this happens is a race between a5xx_submit and
a5xx_preempt_trigger called from IRQ during submit retire. Former thread
updates ring->cur of previously empty and not current ring right after
latter checks it for emptiness. Then both threads can just exit because
for first one preempt_state wasn't NONE yet and for second one all rings
appeared to be empty.

To prevent such situations from happening we need to establish guarantee
for preempt_trigger to make decision after each submit or retire. To
implement this we serialize preemption initiation using spinlock. If
switch is already in progress we need to re-trigger preemption when it
finishes.

Fixes: b1fc2839d2f9 ("drm/msm: Implement preemption for A5XX targets")
Signed-off-by: Vladimir Lypak <vladimir.lypak@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/612045/
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:22 +01:00
..
adreno drm/msm/a5xx: fix races in preemption evaluation stage 2024-11-23 23:21:22 +01:00
disp drm/msm/dpu: don't play tricks with debug macros 2024-11-23 23:20:49 +01:00
dp drm/msm/dp: reset the link phy params before link training 2024-11-23 23:20:49 +01:00
dsi drm/msm/dsi: Enable runtime PM 2024-11-18 12:13:40 +01:00
edp
hdmi
Kconfig
Makefile
msm_atomic.c
msm_atomic_trace.h
msm_atomic_tracepoints.c
msm_debugfs.c
msm_debugfs.h
msm_drv.c
msm_drv.h
msm_fb.c
msm_fbdev.c
msm_fence.c
msm_fence.h
msm_gem.c
msm_gem.h
msm_gem_prime.c
msm_gem_shrinker.c
msm_gem_submit.c
msm_gem_vma.c
msm_gpu.c
msm_gpu.h
msm_gpu_trace.h
msm_gpu_tracepoints.c
msm_gpummu.c
msm_iommu.c
msm_kms.h
msm_mmu.h
msm_perf.c
msm_rd.c
msm_ringbuffer.c
msm_ringbuffer.h
msm_submitqueue.c
NOTES