linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: tmio: Fix hang during suspend
@ 2014-08-14 15:23 Geert Uytterhoeven
  2014-08-15 12:49 ` Ian Molton
  2014-08-15 14:42 ` Ulf Hansson
  0 siblings, 2 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2014-08-14 15:23 UTC (permalink / raw)
  To: Ian Molton, Chris Ball, Ulf Hansson
  Cc: linux-mmc, linux-sh, linux-kernel, Geert Uytterhoeven

On R-Car Gen 2, the SDHI registers cannot be accessed while the SDHI
module clock is disabled. Doing so will cause a lock-up.

When suspending, enable the module clock before disabling the SDHI
interrupts, and disable the clock again afterwards.

This fixes suspend and resume on r8a7791/koelsch.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index faf0924e71cb..83192420a7e3 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -1147,8 +1147,18 @@ int tmio_mmc_host_suspend(struct device *dev)
 {
 	struct mmc_host *mmc = dev_get_drvdata(dev);
 	struct tmio_mmc_host *host = mmc_priv(mmc);
+	struct tmio_mmc_data *pdata = host->pdata;
+
+	if (pdata->clk_enable) {
+		unsigned int f;
+		pdata->clk_enable(host->pdev, &f);
+	}
 
 	tmio_mmc_disable_mmc_irqs(host, TMIO_MASK_ALL);
+
+	if (pdata->clk_disable)
+		pdata->clk_disable(host->pdev);
+
 	return 0;
 }
 EXPORT_SYMBOL(tmio_mmc_host_suspend);
-- 
1.9.1

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

end of thread, other threads:[~2014-08-19  9:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 15:23 [PATCH] mmc: tmio: Fix hang during suspend Geert Uytterhoeven
2014-08-15 12:49 ` Ian Molton
2014-08-18 12:36   ` Geert Uytterhoeven
2014-08-18 13:10     ` Ulf Hansson
2014-08-19  9:18       ` Geert Uytterhoeven
2014-08-15 14:42 ` Ulf Hansson
2014-08-15 15:10   ` Geert Uytterhoeven

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).