* [PATCH] Revert "mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume"
@ 2012-11-07 22:57 Heiko Stübner
2012-11-17 21:14 ` Chris Ball
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Stübner @ 2012-11-07 22:57 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc, Chander Kashyap, Seungwon Jeon
This reverts commit 2abeb5c5ded2e7f7d288058426fb0ae852adc77f, as it breaks
machines using the gpio-based card-detect option with a loop of
mmc0: Timeout waiting for hardware interrupt.
mmc0: Internal clock never stabilised.
mmc0: Timeout waiting for hardware interrupt.
mmc0: Internal clock never stabilised.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
This is of course meant for 3.7-rc
drivers/mmc/host/sdhci-s3c.c | 29 ++---------------------------
1 file changed, 2 insertions(+), 27 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2903949..e019672 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -637,9 +637,7 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
goto err_no_busclks;
}
-#ifndef CONFIG_PM_RUNTIME
clk_enable(sc->clk_bus[sc->cur_clk]);
-#endif
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
@@ -746,15 +744,10 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
gpio_is_valid(pdata->ext_cd_gpio))
sdhci_s3c_setup_card_detect_gpio(sc);
-#ifdef CONFIG_PM_RUNTIME
- clk_disable(sc->clk_io);
-#endif
return 0;
err_req_regs:
-#ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]);
-#endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_put(sc->clk_bus[ptr]);
@@ -793,17 +786,12 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
if (gpio_is_valid(sc->ext_cd_gpio))
gpio_free(sc->ext_cd_gpio);
-#ifdef CONFIG_PM_RUNTIME
- clk_enable(sc->clk_io);
-#endif
sdhci_remove_host(host, 1);
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-#ifndef CONFIG_PM_RUNTIME
clk_disable(sc->clk_bus[sc->cur_clk]);
-#endif
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_put(sc->clk_bus[ptr]);
@@ -843,28 +831,15 @@ static int sdhci_s3c_resume(struct device *dev)
static int sdhci_s3c_runtime_suspend(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
- struct sdhci_s3c *ourhost = to_s3c(host);
- struct clk *busclk = ourhost->clk_io;
- int ret;
-
- ret = sdhci_runtime_suspend_host(host);
- clk_disable(ourhost->clk_bus[ourhost->cur_clk]);
- clk_disable(busclk);
- return ret;
+ return sdhci_runtime_suspend_host(host);
}
static int sdhci_s3c_runtime_resume(struct device *dev)
{
struct sdhci_host *host = dev_get_drvdata(dev);
- struct sdhci_s3c *ourhost = to_s3c(host);
- struct clk *busclk = ourhost->clk_io;
- int ret;
- clk_enable(busclk);
- clk_enable(ourhost->clk_bus[ourhost->cur_clk]);
- ret = sdhci_runtime_resume_host(host);
- return ret;
+ return sdhci_runtime_resume_host(host);
}
#endif
--
1.7.10.4
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] Revert "mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume"
2012-11-07 22:57 [PATCH] Revert "mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume" Heiko Stübner
@ 2012-11-17 21:14 ` Chris Ball
2012-11-18 18:50 ` [PATCH] mmc: sdhci-s3c: fix missing clock for gpio card-detect Heiko Stübner
0 siblings, 1 reply; 4+ messages in thread
From: Chris Ball @ 2012-11-17 21:14 UTC (permalink / raw)
To: Heiko Stübner; +Cc: linux-mmc, Chander Kashyap, Seungwon Jeon
Hi Heiko,
On Wed, Nov 07 2012, Heiko Stübner wrote:
> This reverts commit 2abeb5c5ded2e7f7d288058426fb0ae852adc77f, as it breaks
> machines using the gpio-based card-detect option with a loop of
>
> mmc0: Timeout waiting for hardware interrupt.
> mmc0: Internal clock never stabilised.
> mmc0: Timeout waiting for hardware interrupt.
> mmc0: Internal clock never stabilised.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
This doesn't apply to mmc-next, please could you rebase/resend?
Thanks,
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] mmc: sdhci-s3c: fix missing clock for gpio card-detect
2012-11-17 21:14 ` Chris Ball
@ 2012-11-18 18:50 ` Heiko Stübner
2012-11-18 19:05 ` Chris Ball
0 siblings, 1 reply; 4+ messages in thread
From: Heiko Stübner @ 2012-11-18 18:50 UTC (permalink / raw)
To: Chris Ball; +Cc: linux-mmc, Chander Kashyap, Seungwon Jeon
Commit 2abeb5c5ded2 (Add clk_(enable/disable) in runtime suspend/resume)
added the capability to stop the clocks when the device is runtime
suspended, but forgot to handle the case of the card-detect using
an external gpio.
Therefore in the case that runtime-pm is enabled, start the io-clock
when a card is inserted and stop it again once it is removed.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
drivers/mmc/host/sdhci-s3c.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
This _should_ go into 3.7 because currently it causes a regression there.
Nevertheless it applies to both 3.7-rc6 and linux-next.
I also tried to use pm_runtime_get_sync (and _put) there, but it didn't
seem to work and the clock was still missing. With the changes in this
patch, the gpio-card-detect works again on my machine - all of insert,
remove and reinsert.
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index a54dd5d..c9ec725 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -373,18 +373,25 @@ static struct sdhci_ops sdhci_s3c_ops = {
static void sdhci_s3c_notify_change(struct platform_device *dev, int state)
{
struct sdhci_host *host = platform_get_drvdata(dev);
+ struct sdhci_s3c *sc = sdhci_priv(host);
unsigned long flags;
if (host) {
spin_lock_irqsave(&host->lock, flags);
if (state) {
dev_dbg(&dev->dev, "card inserted.\n");
+#ifdef CONFIG_PM_RUNTIME
+ clk_prepare_enable(sc->clk_io);
+#endif
host->flags &= ~SDHCI_DEVICE_DEAD;
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
} else {
dev_dbg(&dev->dev, "card removed.\n");
host->flags |= SDHCI_DEVICE_DEAD;
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+#ifdef CONFIG_PM_RUNTIME
+ clk_disable_unprepare(sc->clk_io);
+#endif
}
tasklet_schedule(&host->card_tasklet);
spin_unlock_irqrestore(&host->lock, flags);
--
1.7.2.3
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mmc: sdhci-s3c: fix missing clock for gpio card-detect
2012-11-18 18:50 ` [PATCH] mmc: sdhci-s3c: fix missing clock for gpio card-detect Heiko Stübner
@ 2012-11-18 19:05 ` Chris Ball
0 siblings, 0 replies; 4+ messages in thread
From: Chris Ball @ 2012-11-18 19:05 UTC (permalink / raw)
To: Heiko Stübner; +Cc: linux-mmc, Chander Kashyap, Seungwon Jeon
Hi,
On Sun, Nov 18 2012, Heiko Stübner wrote:
> Commit 2abeb5c5ded2 (Add clk_(enable/disable) in runtime suspend/resume)
> added the capability to stop the clocks when the device is runtime
> suspended, but forgot to handle the case of the card-detect using
> an external gpio.
>
> Therefore in the case that runtime-pm is enabled, start the io-clock
> when a card is inserted and stop it again once it is removed.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Thanks, pushed to mmc-next for 3.7.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-18 19:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-07 22:57 [PATCH] Revert "mmc: sdhci-s3c: Add clk_(enable/disable) in runtime suspend/resume" Heiko Stübner
2012-11-17 21:14 ` Chris Ball
2012-11-18 18:50 ` [PATCH] mmc: sdhci-s3c: fix missing clock for gpio card-detect Heiko Stübner
2012-11-18 19:05 ` Chris Ball
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.