aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
diff options
context:
space:
mode:
authorSteven Price <[email protected]>2019-10-09 09:44:55 +0000
committerRob Herring <[email protected]>2019-10-15 16:38:22 +0000
commit5b3ec8134f5f9fa1ed0a538441a495521078bbee (patch)
treef6ef968ec57b77e4c8f44d388b4cc427a1ae347b /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
parentdrm/panfrost: Add missing GPU feature registers (diff)
downloadkernel-5b3ec8134f5f9fa1ed0a538441a495521078bbee.tar.gz
kernel-5b3ec8134f5f9fa1ed0a538441a495521078bbee.zip
drm/panfrost: Handle resetting on timeout better
Panfrost uses multiple schedulers (one for each slot, so 2 in reality), and on a timeout has to stop all the schedulers to safely perform a reset. However more than one scheduler can trigger a timeout at the same time. This race condition results in jobs being freed while they are still in use. When stopping other slots use cancel_delayed_work_sync() to ensure that any timeout started for that slot has completed. Also use mutex_trylock() to obtain reset_lock. This means that only one thread attempts the reset, the other threads will simply complete without doing anything (the first thread will wait for this in the call to cancel_delayed_work_sync()). While we're here and since the function is already dependent on sched_job not being NULL, let's remove the unnecessary checks. Fixes: aa20236784ab ("drm/panfrost: Prevent concurrent resets") Tested-by: Neil Armstrong <[email protected]> Signed-off-by: Steven Price <[email protected]> Cc: [email protected] Signed-off-by: Rob Herring <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
0 files changed, 0 insertions, 0 deletions