Re: [PATCH] pcmcia: fix setting of kthread task states
From: Matthew Wilcox
Date: Sun Jan 09 2022 - 15:22:48 EST
On Sun, Jan 09, 2022 at 09:14:15PM +0100, Dominik Brodowski wrote:
> We need to set TASK_INTERRUPTIBLE before calling kthread_should_stop().
> Otherwise, kthread_stop() might see that the pccardd thread is still
> in TASK_RUNNING state and fail to wake it up.
>
> Additonally, we only need to set the state back to TASK_RUNNING if
> kthread_should_stop() breaks the loop.
>
> Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx>
> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Reported-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
> Fixes: d3046ba809ce ("pcmcia: fix a boot time warning in pcmcia cs code")
> Signed-off-by: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>