linux-yocto/drivers/gpu/drm/v3d
Maíra Canal 5235b56b7e drm/v3d: Add job to pending list if the reset was skipped
commit 35e4079bf1a2570abffce6ababa631afcf8ea0e5 upstream.

When a CL/CSD job times out, we check if the GPU has made any progress
since the last timeout. If so, instead of resetting the hardware, we skip
the reset and let the timer get rearmed. This gives long-running jobs a
chance to complete.

However, when `timedout_job()` is called, the job in question is removed
from the pending list, which means it won't be automatically freed through
`free_job()`. Consequently, when we skip the reset and keep the job
running, the job won't be freed when it finally completes.

This situation leads to a memory leak, as exposed in [1] and [2].

Similarly to commit 704d3d60fe ("drm/etnaviv: don't block scheduler when
GPU is still active"), this patch ensures the job is put back on the
pending list when extending the timeout.

Cc: stable@vger.kernel.org # 6.0
Reported-by: Daivik Bhatia <dtgs1208@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12227 [1]
Closes: https://github.com/raspberrypi/linux/issues/6817 [2]
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Link: https://lore.kernel.org/r/20250430210643.57924-1-mcanal@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-05-18 08:21:23 +02:00
..
Kconfig drm/v3d: Add support for bcm2711 2022-06-12 22:10:50 -01:00
Makefile
v3d_bo.c drm/gem-shmem: Set vm_ops in static initializer 2022-02-14 09:42:01 +01:00
v3d_debugfs.c drm/v3d: Get rid of pm code 2022-06-12 22:10:40 -01:00
v3d_drv.c drm/fb: remove unused includes of drm_fb_cma_helper.h 2022-08-03 18:30:20 +02:00
v3d_drv.h
v3d_fence.c
v3d_gem.c drm/gem: rename GEM CMA helpers to GEM DMA helpers 2022-08-03 18:31:49 +02:00
v3d_irq.c drm/v3d: Assign job pointer to NULL before signaling the fence 2025-02-01 18:30:11 +01:00
v3d_mmu.c drm/v3d: Address race-condition in MMU flush 2024-12-14 19:53:26 +01:00
v3d_perfmon.c drm/v3d: Stop active perfmon if it is being destroyed 2025-02-21 13:50:09 +01:00
v3d_regs.h
v3d_sched.c drm/v3d: Add job to pending list if the reset was skipped 2025-05-18 08:21:23 +02:00
v3d_trace_points.c
v3d_trace.h