drm/amdkfd: Handle restart of kfd_ioctl_wait_events
authorFelix Kuehling <Felix.Kuehling@amd.com>
Thu, 4 Aug 2022 22:19:38 +0000 (18:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 10 Aug 2022 19:41:23 +0000 (15:41 -0400)
commitbea9a56afbc4b5a41ea579b8b0dc5e189b439504
tree1eaac74557086267015dbeb64f40a32a4c934743
parentc4c10a68e82b8a03df234ee744acabcc648df270
drm/amdkfd: Handle restart of kfd_ioctl_wait_events

When kfd_ioctl_wait_events needs to restart due to a signal, we need to
update the timeout to account for the time already elapsed. We also need
to undo auto_reset of events that have signaled already, so that the
restarted ioctl will be able to count those signals again.

This fixes infinite hangs when kfd_ioctl_wait_events is interrupted by a
signal.

Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-and-tested-by: Xiaogang Chen <Xiaogang.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
drivers/gpu/drm/amd/amdkfd/kfd_events.c
drivers/gpu/drm/amd/amdkfd/kfd_priv.h