wakeup the target thread in kthread_park() fixes hang in amdgpu GPU reset sequence, mirrors the linux semantics. diff --git a/sys/external/bsd/drm2/linux/linux_kthread.c b/sys/external/bsd/drm2/linux/linux_kthread.c index bb5c7d576afe..211704bc0374 100644 --- a/sys/external/bsd/drm2/linux/linux_kthread.c +++ b/sys/external/bsd/drm2/linux/linux_kthread.c @@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD$"); #include #include #include +#include #include @@ -188,6 +189,8 @@ kthread_park(struct task_struct *T) mutex_enter(&T->kt_lock); KASSERT(!T->kt_shouldstop); T->kt_shouldpark = true; + if (T->kt_lwp != curlwp) + sleepq_timeout(T->kt_lwp); while (!T->kt_parked) cv_wait(&T->kt_cv, &T->kt_lock); mutex_exit(&T->kt_lock);