mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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:
|
||
|---|---|---|
| .. | ||
| cmdstream.xml.h | ||
| common.xml.h | ||
| etnaviv_buffer.c | ||
| etnaviv_buffer.h | ||
| etnaviv_cmd_parser.c | ||
| etnaviv_cmdbuf.c | ||
| etnaviv_cmdbuf.h | ||
| etnaviv_drv.c | ||
| etnaviv_drv.h | ||
| etnaviv_dump.c | ||
| etnaviv_dump.h | ||
| etnaviv_flop_reset.c | ||
| etnaviv_flop_reset.h | ||
| etnaviv_gem_prime.c | ||
| etnaviv_gem_submit.c | ||
| etnaviv_gem.c | ||
| etnaviv_gem.h | ||
| etnaviv_gpu.c | ||
| etnaviv_gpu.h | ||
| etnaviv_hwdb.c | ||
| etnaviv_iommu_v2.c | ||
| etnaviv_iommu.c | ||
| etnaviv_mmu.c | ||
| etnaviv_mmu.h | ||
| etnaviv_perfmon.c | ||
| etnaviv_perfmon.h | ||
| etnaviv_sched.c | ||
| etnaviv_sched.h | ||
| Kconfig | ||
| Makefile | ||
| state_3d.xml.h | ||
| state_blt.xml.h | ||
| state_hi.xml.h | ||
| state.xml.h | ||