linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: core: do power-off with resume failure
@ 2013-08-21 12:42 Seungwon Jeon
  2013-08-23  8:36 ` Ulf Hansson
  0 siblings, 1 reply; 5+ messages in thread
From: Seungwon Jeon @ 2013-08-21 12:42 UTC (permalink / raw)
  To: linux-mmc; +Cc: 'Chris Ball'

Currently there is no mmc_power_off() when resume failed.
Somehow, state from mmc_power_on() will be kept. This change
makes a pair with its use in case of failure.

Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
---
 drivers/mmc/core/mmc.c  |    3 +++
 drivers/mmc/core/sd.c   |    3 +++
 drivers/mmc/core/sdio.c |    3 +++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 6d02012..704a561 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1536,6 +1536,9 @@ static int mmc_resume(struct mmc_host *host)
 	mmc_power_up(host);
 	mmc_select_voltage(host, host->ocr);
 	err = mmc_init_card(host, host->ocr, host->card);
+	if (err)
+		mmc_power_off(host);
+
 	mmc_release_host(host);
 
 	return err;
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 176d125..2690ae1 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1099,6 +1099,9 @@ static int mmc_sd_resume(struct mmc_host *host)
 	mmc_power_up(host);
 	mmc_select_voltage(host, host->ocr);
 	err = mmc_sd_init_card(host, host->ocr, host->card);
+	if (err)
+		mmc_power_off(host);
+
 	mmc_release_host(host);
 
 	return err;
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 80d89cf..8c65669 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1033,6 +1033,9 @@ static int mmc_sdio_resume(struct mmc_host *host)
 		}
 	}
 
+	if (err && !mmc_card_keep_power(host))
+		mmc_power_off(host);
+
 	host->pm_flags &= ~MMC_PM_KEEP_POWER;
 	return err;
 }
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-08-26 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-21 12:42 [PATCH 1/3] mmc: core: do power-off with resume failure Seungwon Jeon
2013-08-23  8:36 ` Ulf Hansson
2013-08-26  6:39   ` Seungwon Jeon
2013-08-26  7:11     ` Ulf Hansson
2013-08-26 10:56       ` Seungwon Jeon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).