diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 7f4c5e0aad3e..1b4487048d85 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -427,9 +427,9 @@ __sched int autoremove_wake_function(struct wait_queue_entry *wq_entry, unsigned } EXPORT_SYMBOL(autoremove_wake_function); -static inline bool is_kthread_should_stop(void) +static inline bool is_kthread_should_stop_or_park(void) { - return (current->flags & PF_KTHREAD) && kthread_should_stop(); + return (current->flags & PF_KTHREAD) && (kthread_should_stop() || kthread_should_park()); } /* @@ -461,7 +461,7 @@ __sched long wait_woken(struct wait_queue_entry *wq_entry, unsigned int mode, lo * or woken_wake_function() sees our store to current->state. */ set_current_state(mode); /* A */ - if (!(wq_entry->flags & WQ_FLAG_WOKEN) && !is_kthread_should_stop()) + if (!(wq_entry->flags & WQ_FLAG_WOKEN) && !is_kthread_should_stop_or_park()) timeout = schedule_timeout(timeout); __set_current_state(TASK_RUNNING);