From 0e6396ed35ce5ddf8825298f08faa4bb598d2750 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Sun, 24 Apr 2016 16:49:25 +0200 Subject: mmc: host: sdhci: fix suspend/resume issue This fixes the following eMMC suspend/resume issue as seen on Colibri T30 1GB IT V1.1A: [ 75.479664] mmcblk0: error -110 transferring data, sector 287240, nr 2, cmd response 0x900, card status 0xc00 [ 75.580923] end_request: I/O error, dev mmcblk0, sector 287240 [ 75.586782] Buffer I/O error on device mmcblk0p2, logical block 123140 [ 75.593313] lost page write due to I/O error on mmcblk0p2 (fixes an issue probably caused by a merge conflict introduced by commit 7f7b042a978edfc6c7d1e14ec9c6ec01ffcc284b) Signed-off-by: Mirza Krak Signed-off-by: Marcel Ziswiler Acked-by: Dominik Sliwa --- drivers/mmc/host/sdhci.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers') diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1aed27869b3c..41b578299e66 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2439,6 +2439,15 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state) } if (mmc->card) { + /* + * If eMMC cards are put in sleep state, Vccq can be disabled + * but Vcc would still be powered on. In resume, we only restore + * the controller context. So, set MMC_PM_KEEP_POWER flag. + */ + if (mmc_card_can_sleep(mmc) && + !(mmc->caps & MMC_CAP2_NO_SLEEP_CMD)) + mmc->pm_flags = MMC_PM_KEEP_POWER; + ret = mmc_suspend_host(host->mmc); if (ret) goto err_suspend_host; -- cgit v1.2.3