OpenCloudOS-Kernel/drivers/gpu/drm/scheduler
Dmitry Osipenko 03dec92c4f drm/scheduler: Fix lockup in drm_sched_entity_kill()
The drm_sched_entity_kill() is invoked twice by drm_sched_entity_destroy()
while userspace process is exiting or being killed. First time it's invoked
when sched entity is flushed and second time when entity is released. This
causes a lockup within wait_for_completion(entity_idle) due to how completion
API works.

Calling wait_for_completion() more times than complete() was invoked is a
error condition that causes lockup because completion internally uses
counter for complete/wait calls. The complete_all() must be used instead
in such cases.

This patch fixes lockup of Panfrost driver that is reproducible by killing
any application in a middle of 3d drawing operation.

Fixes: 2fdb8a8f07 ("drm/scheduler: rework entity flush, kill and fini")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> # Steam Deck
Link: https://patchwork.freedesktop.org/patch/msgid/20221123001303.533968-1-dmitry.osipenko@collabora.com
2023-01-02 17:45:18 +03:00
..
Makefile drm/scheduler: rename gpu_scheduler.c to sched_main.c 2018-08-27 11:10:44 -05:00
gpu_scheduler_trace.h drm/sched: use __string in tracepoints 2022-04-26 15:11:00 -04:00
sched_entity.c drm/scheduler: Fix lockup in drm_sched_entity_kill() 2023-01-02 17:45:18 +03:00
sched_fence.c drm/sched: Fix drm_sched_fence_free() so it can be passed an uninitialized fence 2021-09-07 09:58:26 +02:00
sched_main.c drm/scheduler: Fix lockup in drm_sched_entity_kill() 2023-01-02 17:45:18 +03:00