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 20:26:53 +0000 (15:26 -0500)
commitf2efc6e60089c99c342a6b7da47f1037e06c4296
treed5cbfe0aadd099c9c533f5e76ab90ddacec8ddc7
parent576daab3cd029558b58c264694d84ff159572f9b
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