diff mbox

[v2] sdio: skip initialization on powered resume

Message ID 1283391692-14150-1-git-send-email-bzhao@marvell.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Bing Zhao Sept. 2, 2010, 1:41 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index f332c52..64d2471 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -605,15 +605,23 @@  static int mmc_sdio_suspend(struct mmc_host *host)
 
 static int mmc_sdio_resume(struct mmc_host *host)
 {
-	int i, err;
+	int i, err = 0;
 
 	BUG_ON(!host);
 	BUG_ON(!host->card);
 
 	/* Basic card reinitialization. */
 	mmc_claim_host(host);
-	err = mmc_sdio_init_card(host, host->ocr, host->card,
-				 (host->pm_flags & MMC_PM_KEEP_POWER));
+
+	/*
+	 * Simplified SDIO spec v2.00 (section 6.14 - Bus State Diagram)
+	 * suggests that initialization should be skipped on powered resume.
+	 */
+	if (!(host->pm_flags & MMC_PM_KEEP_POWER)) {
+		err = mmc_sdio_init_card(host, host->ocr, host->card,
+					host->pm_flags & MMC_PM_KEEP_POWER);
+	}
+
 	if (!err) {
 		/* We may have switched to 1-bit mode during suspend. */
 		err = sdio_enable_4bit_bus(host->card);