drm/amdgpu: dont schedule jobs while in reset
authorShirish S <shirish.s@amd.com>
Wed, 30 Oct 2019 08:50:46 +0000 (14:20 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 6 Nov 2019 19:20:24 +0000 (14:20 -0500)
commit89b3d86403f1025f6b430d8f9ffc590efbadce62
tree1386b74502a2eb34e717dd95f71ea4d90bb475dd
parente2f619aa14b68aff4c1442acffdb6a322c613c06
drm/amdgpu: dont schedule jobs while in reset

[Why]

doing kthread_park()/unpark() from drm_sched_entity_fini
while GPU reset is in progress defeats all the purpose of
drm_sched_stop->kthread_park.
If drm_sched_entity_fini->kthread_unpark() happens AFTER
drm_sched_stop->kthread_park nothing prevents from another
(third) thread to keep submitting job to HW which will be
picked up by the unparked scheduler thread and try to submit
to HW but fail because the HW ring is deactivated.

[How]
grab the reset lock before calling drm_sched_entity_fini()

Signed-off-by: Shirish S <shirish.s@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c