drm/amdkfd: fix race condition in kfd_wait_on_events
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 12 Apr 2022 20:24:49 +0000 (16:24 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 14 Apr 2022 19:29:13 +0000 (15:29 -0400)
commit250e64a3f06c42e993e7b8c6f727d43b5b9f8c96
tree469d936f31dc90ae9a295ffcf0e9e5bda8501251
parent9e12b5947bbaa74db32e24d77ebf3bd71015970c
drm/amdkfd: fix race condition in kfd_wait_on_events

Add the waiters to the wait queue during initialization, while holding the
event spinlock. Otherwise the waiter will not get activated if the event
signals before being added to the wait queue.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: Philip Yang<Philip.Yang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_events.c