memstick: Skip allocating card when removing host
authorKai-Heng Feng <kai.heng.feng@canonical.com>
Fri, 25 Sep 2020 08:49:51 +0000 (16:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Oct 2020 06:02:46 +0000 (08:02 +0200)
commitb64a43b072c76f553b2dae9f105733bb97d9bc00
tree6b7c4487f048898ad870b3054e8f013f2c83a9e5
parent13cee195a18083173c757f6af3bb23271cc22144
memstick: Skip allocating card when removing host

commit 62c59a8786e6bb75569cee91dab66e9da3ff4b68 upstream.

After commit 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power
management"), removing module rtsx_usb_ms will be stuck.

The deadlock is caused by powering on and powering off at the same time,
the former one is when memstick_check() is flushed, and the later is called
by memstick_remove_host().

Soe let's skip allocating card to prevent this issue.

Fixes: 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power management")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Link: https://lore.kernel.org/r/20200925084952.13220-1-kai.heng.feng@canonical.com
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/memstick/core/memstick.c
include/linux/memstick.h