]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Fix deadlock during GPU reset.
authorAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Thu, 12 Oct 2017 20:46:26 +0000 (16:46 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 4 Dec 2017 21:33:11 +0000 (16:33 -0500)
commit8d38fe2be6386c9357290c291692b8badd39bb60
tree6e9a6740c8bb3f720ac65a480e5ec347c278d240
parent8c0e1129a9862eea56e1b767250cddad75d76407
drm/amdgpu: Fix deadlock during GPU reset.

Bug:
Kfifo is limited at size, during GPU reset it would fill up to limit
and the pushing thread (producer) would wait for the scheduler worker to
consume the items in the fifo while holding reservation lock
on a BO. The gpu reset thread on the other hand blocks the scheduler
during reset. Before it unblocks the sceduler it might want
to recover VRAM and so will try to reserve the same BO the producer
thread is already holding creating a deadlock.

Fix:
Switch from kfifo to SPSC queue which is unlimited in size.

Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h