[PATCH] [RFC] mmc: perform SDIO reset on power restore of host

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On some boards card power is hard wired to the slot
and active regardless of host controller state.
When runtime PM suspends such a host, certain cards
may keep their current configuration (e.g. bus width),
now when runtime PM resumes the host, communication
with the card will fail.
This was observed on AP4EVB with tmio_mmc and a b43 based
SDIO card:
http://marc.info/?l=linux-mmc&m=128854536521274&w=2

This patch, fixes the problem by resetting the SDIO
card on power restore.

Signed-off-by: Arnd Hannemann <arnd@xxxxxxxxxx>
---
 drivers/mmc/core/core.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 31ae07a..21cdee6 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1617,8 +1617,13 @@ int mmc_power_restore_host(struct mmc_host *host)
 	}
 
 	mmc_power_up(host);
-	ret = host->bus_ops->power_restore(host);
 
+	mmc_claim_host(host);
+	sdio_reset(host);
+	mmc_go_idle(host);
+	mmc_release_host(host);
+
+	ret = host->bus_ops->power_restore(host);
 	mmc_bus_put(host);
 
 	return ret;
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux