linux/drivers/gpu/drm/etnaviv
Maíra Canal 3780c41460 drm/etnaviv: Fix armed job not being pushed to the DRM scheduler
When xa_alloc_cyclic() failed in etnaviv_sched_push_job(), the error
path skipped drm_sched_entity_push_job(). This is a violation of the DRM
scheduler contract, as once a job has been armed with drm_sched_job_arm(),
it must be pushed with drm_sched_entity_push_job(). From the DRM
scheduler documentation,

"""
drm_sched_job_arm() is a point of no return since it initializes the
fences and their sequence number etc. Once that function has been called,
you *must* submit it with drm_sched_entity_push_job() and cannot simply
abort it by calling drm_sched_job_cleanup().
"""

Fix this by splitting the fence ID allocation into two phases: first,
alloc an xarray slot before arming the job (which can fail), then fill in
the actual fence with xa_store() after arming. This way, allocation
failures are handled before the job is armed, and once armed, the job is
always pushed to the scheduler.

This also fixes a double call to drm_sched_job_cleanup(), as both
etnaviv_sched_push_job() and its caller would call it on failure.

Fixes: 764be12345 ("drm/etnaviv: convert user fence tracking to XArray")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patch.msgid.link/20260402193424.2023318-1-mcanal@igalia.com
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
2026-05-05 11:40:16 +02:00
..
cmdstream.xml.h drm/etnaviv: Update hardware headers from rnndb 2024-05-16 19:06:33 +02:00
common.xml.h drm/etnaviv: Update hardware headers from rnndb 2024-05-16 19:06:33 +02:00
etnaviv_buffer.c drm/etnaviv: Add PPU flop reset 2026-01-06 16:43:19 +01:00
etnaviv_buffer.h drm/etnaviv: Add PPU flop reset 2026-01-06 16:43:19 +01:00
etnaviv_cmd_parser.c drm/etnaviv: add sensitive state for PE_RT_ADDR_4_PIPE(3, 0|1) address 2024-01-23 10:20:21 +01:00
etnaviv_cmdbuf.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_cmdbuf.h
etnaviv_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_drv.h drm/etnaviv: Add PPU flop reset 2026-01-06 16:43:19 +01:00
etnaviv_dump.c drm/etnaviv: switch devcoredump allocations to GFP_NOWAIT 2024-06-26 15:31:33 +02:00
etnaviv_dump.h
etnaviv_flop_reset.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
etnaviv_flop_reset.h drm/etnaviv: Add PPU flop reset 2026-01-06 16:43:19 +01:00
etnaviv_gem_prime.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_gem_submit.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
etnaviv_gem.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_gem.h drm/etnaviv: Drop unused data member from the etnaviv_gem_object structure 2024-12-03 18:27:33 +01:00
etnaviv_gpu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_gpu.h drm/etnaviv: add optional reset support 2024-12-20 19:25:51 +01:00
etnaviv_hwdb.c drm/etnaviv: add HWDB entry for GC8000 Nano Ultra VIP r6205 2025-11-04 16:44:40 +01:00
etnaviv_iommu_v2.c
etnaviv_iommu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_mmu.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
etnaviv_mmu.h drm/etnaviv: Drop the 'struct etnaviv_iommu_global::pta_lock' data member 2024-10-28 16:49:37 +01:00
etnaviv_perfmon.c drm/etnaviv: assert GPU lock held in perfmon pipe_*_read functions 2024-10-28 16:33:43 +01:00
etnaviv_perfmon.h
etnaviv_sched.c drm/etnaviv: Fix armed job not being pushed to the DRM scheduler 2026-05-05 11:40:16 +02:00
etnaviv_sched.h
Kconfig
Makefile drm/etnaviv: Add PPU flop reset 2026-01-06 16:43:19 +01:00
state_3d.xml.h drm/etnaviv: Add command stream definitions required for a PPU flop reset 2026-01-06 16:43:15 +01:00
state_blt.xml.h drm/etnaviv: Update hardware headers from rnndb 2024-05-16 19:06:33 +02:00
state_hi.xml.h drm/etnaviv: update hardware headers from rnndb 2024-10-28 16:34:16 +01:00
state.xml.h drm/etnaviv: Update hardware headers from rnndb 2024-05-16 19:06:33 +02:00