All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [RFC] mmc: perform SDIO reset on power restore of host
@ 2010-12-28 11:25 Arnd Hannemann
  2010-12-28 12:45 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Hannemann @ 2010-12-28 11:25 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Ohad Ben-Cohen, Arnd Hannemann

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@arndnet.de>
---
 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


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

end of thread, other threads:[~2010-12-29 12:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-28 11:25 [PATCH] [RFC] mmc: perform SDIO reset on power restore of host Arnd Hannemann
2010-12-28 12:45 ` Ohad Ben-Cohen
2010-12-28 14:03   ` Arnd Hannemann
2010-12-28 14:24     ` Ohad Ben-Cohen
2010-12-29 10:35       ` Arnd Hannemann
2010-12-29 12:11         ` Ohad Ben-Cohen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.