]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
pcmcia: fix setting of kthread task states
authorDominik Brodowski <linux@dominikbrodowski.net>
Sun, 9 Jan 2022 09:02:51 +0000 (10:02 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 7 Mar 2022 15:35:56 +0000 (16:35 +0100)
commit620bcd644fba338dfa5b09cbb98c46c25769e057
treef93477075e574fd4773d49031fd396ef9948faf5
parent22479fb1d2a393bd50d4dc067cfa5898d89c50ca
pcmcia: fix setting of kthread task states

BugLink: https://bugs.launchpad.net/bugs/1960566
[ Upstream commit fbb3485f1f931102d8ba606f1c28123f5b48afa3 ]

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: d3046ba809ce ("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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/pcmcia/cs.c