mmc: rtsx_usb_sdmmc: Avoid keeping the device runtime resumed when unused
authorUlf Hansson <ulf.hansson@linaro.org>
Tue, 27 Sep 2016 15:44:33 +0000 (08:44 -0700)
committerSasha Levin <alexander.levin@verizon.com>
Tue, 1 Nov 2016 19:17:40 +0000 (15:17 -0400)
[ Upstream commit 31cf742f515c275d22843c4c756e048d2b6d716c ]

The rtsx_usb_sdmmc driver may bail out in its ->set_ios() callback when no
SD card is inserted. This is wrong, as it could cause the device to remain
runtime resumed when it's unused. Fix this behaviour.

Tested-by: Ritesh Raj Sarraf <rrs@researchut.com>
Cc: <stable@vger.kernel.org>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/mmc/host/rtsx_usb_sdmmc.c

index 88af827e086b9f66b5acbfe663cb8837b1d62d24..c7a3144379c32720075d87c986a8c2fc84d23fc7 100644 (file)
@@ -1138,11 +1138,6 @@ static void sdmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
        dev_dbg(sdmmc_dev(host), "%s\n", __func__);
        mutex_lock(&ucr->dev_mutex);
 
-       if (rtsx_usb_card_exclusive_check(ucr, RTSX_USB_SD_CARD)) {
-               mutex_unlock(&ucr->dev_mutex);
-               return;
-       }
-
        sd_set_power_mode(host, ios->power_mode);
        sd_set_bus_width(host, ios->bus_width);
        sd_set_timing(host, ios->timing, &host->ddr_mode);