Commit b166010f6afbadb896efa37ff85eb681a8f89392
Committed by
Lee Jones
1 parent
f29ae369a4
Exists in
ti-lsk-linux-4.1.y
and in
10 other branches
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: 730876be2566 ("mfd: Add realtek USB card reader driver") Signed-off-by: Roger Tseng <rogerable@realtek.com> [Lee: Removed newly unused variable] Signed-off-by: Lee Jones <lee.jones@linaro.org>
Showing 1 changed file with 0 additions and 12 deletions Side-by-side Diff
drivers/mfd/rtsx_usb.c
... | ... | @@ -681,20 +681,8 @@ |
681 | 681 | #ifdef CONFIG_PM |
682 | 682 | static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message) |
683 | 683 | { |
684 | - struct rtsx_ucr *ucr = | |
685 | - (struct rtsx_ucr *)usb_get_intfdata(intf); | |
686 | - | |
687 | 684 | dev_dbg(&intf->dev, "%s called with pm message 0x%04x\n", |
688 | 685 | __func__, message.event); |
689 | - | |
690 | - /* | |
691 | - * Call to make sure LED is off during suspend to save more power. | |
692 | - * It is NOT a permanent state and could be turned on anytime later. | |
693 | - * Thus no need to call turn_on when resunming. | |
694 | - */ | |
695 | - mutex_lock(&ucr->dev_mutex); | |
696 | - rtsx_usb_turn_off_led(ucr); | |
697 | - mutex_unlock(&ucr->dev_mutex); | |
698 | 686 | |
699 | 687 | return 0; |
700 | 688 | } |