]> www.infradead.org Git - users/hch/misc.git/commit
drm/v3d: Set job pointer to NULL when the job's fence has an error
authorMaíra Canal <mcanal@igalia.com>
Thu, 13 Mar 2025 14:43:27 +0000 (11:43 -0300)
committerMaíra Canal <mcanal@igalia.com>
Thu, 13 Mar 2025 19:50:43 +0000 (16:50 -0300)
commitc3e4a25602f8b941b154f52a4da13ae77b4664c4
tree25b7e8f75d3ad3c19940309500e4671130ab379e
parent80cbee810e4e13cdbd3ae9654e9ecddf17f3e828
drm/v3d: Set job pointer to NULL when the job's fence has an error

Similar to commit e4b5ccd392b9 ("drm/v3d: Ensure job pointer is set to
NULL after job completion"), ensure the job pointer is set to `NULL` when
a job's fence has an error. Failing to do so can trigger kernel warnings
in specific scenarios, such as:

1. v3d_csd_job_run() assigns `v3d->csd_job = job`
2. CSD job exceeds hang limit, causing a timeout → v3d_gpu_reset_for_timeout()
3. GPU reset
4. drm_sched_resubmit_jobs() sets the job's fence to `-ECANCELED`.
5. v3d_csd_job_run() detects the fence error and returns NULL, not
   submitting the job to the GPU
6. User-space runs `modprobe -r v3d`
7. v3d_gem_destroy()

v3d_gem_destroy() triggers a warning indicating that the CSD job never
ended, as we didn't set `v3d->csd_job` to NULL after the timeout. The same
can also happen to BIN, RENDER, and TFU jobs.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250313-v3d-gpu-reset-fixes-v4-2-c1e780d8e096@igalia.com
drivers/gpu/drm/v3d/v3d_sched.c