mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 03:40:04 +00:00
pcmcia: fix setting of kthread task states
[ Upstream commitfbb3485f1f
] 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. Additionally, we only need to set the state back to TASK_RUNNING if kthread_should_stop() breaks the loop. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reported-by: Al Viro <viro@ZenIV.linux.org.uk> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Fixes:d3046ba809
("pcmcia: fix a boot time warning in pcmcia cs code") Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
f56b423bce
commit
ff09d5951b
1 changed files with 3 additions and 5 deletions
|
@ -666,18 +666,16 @@ static int pccardd(void *__skt)
|
||||||
if (events || sysfs_events)
|
if (events || sysfs_events)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
if (kthread_should_stop())
|
if (kthread_should_stop())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
set_current_state(TASK_INTERRUPTIBLE);
|
|
||||||
|
|
||||||
schedule();
|
schedule();
|
||||||
|
|
||||||
/* make sure we are running */
|
|
||||||
__set_current_state(TASK_RUNNING);
|
|
||||||
|
|
||||||
try_to_freeze();
|
try_to_freeze();
|
||||||
}
|
}
|
||||||
|
/* make sure we are running before we exit */
|
||||||
|
__set_current_state(TASK_RUNNING);
|
||||||
|
|
||||||
/* shut down socket, if a device is still present */
|
/* shut down socket, if a device is still present */
|
||||||
if (skt->state & SOCKET_PRESENT) {
|
if (skt->state & SOCKET_PRESENT) {
|
||||||
|
|
Loading…
Reference in a new issue