提交 b166010f 编写于 作者: R Roger Tseng 提交者: Lee Jones

mfd: rtsx_usb: Fix runtime PM deadlock

sd_set_power_mode() in derived module drivers/mmc/host/rtsx_usb_sdmmc.c
acquires dev_mutex and then calls pm_runtime_get_sync() to make sure the
device is awake while initializing a newly inserted card. Once it is
called during suspending state and explicitly before rtsx_usb_suspend()
acquires the same dev_mutex, both routine deadlock and further hang the
driver because pm_runtime_get_sync() waits the pending PM operations.

Fix this by using an empty suspend method. mmc_core always turns the
LED off after a request is done and thus it is ok to remove the only
rtsx_usb_turn_off_led() here.

Cc: <stable@vger.kernel.org> # v3.16+
Fixes: 730876be ("mfd: Add realtek USB card reader driver")
Signed-off-by: NRoger Tseng <rogerable@realtek.com>
[Lee: Removed newly unused variable]
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 f29ae369
......@@ -681,21 +681,9 @@ static void rtsx_usb_disconnect(struct usb_interface *intf)
#ifdef CONFIG_PM
static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message)
{
struct rtsx_ucr *ucr =
(struct rtsx_ucr *)usb_get_intfdata(intf);
dev_dbg(&intf->dev, "%s called with pm message 0x%04x\n",
__func__, message.event);
/*
* Call to make sure LED is off during suspend to save more power.
* It is NOT a permanent state and could be turned on anytime later.
* Thus no need to call turn_on when resunming.
*/
mutex_lock(&ucr->dev_mutex);
rtsx_usb_turn_off_led(ucr);
mutex_unlock(&ucr->dev_mutex);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册