summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sdio_irq.c
diff options
context:
space:
mode:
authorSujit Reddy Thumma <sthumma@codeaurora.org>2012-02-04 16:14:50 -0500
committerChris Ball <cjb@laptop.org>2012-02-13 20:38:58 -0500
commit2c4967f741e87cdd63de7271b97807041dccbf3b (patch)
treee9792b49e457393d275db4ab3948fa95f1ef57d6 /drivers/mmc/core/sdio_irq.c
parentb6bf30d912ddc9a3ac2ce264a04e3ec6d4e74a34 (diff)
downloadop-kernel-dev-2c4967f741e87cdd63de7271b97807041dccbf3b.zip
op-kernel-dev-2c4967f741e87cdd63de7271b97807041dccbf3b.tar.gz
mmc: core: Ensure clocks are always enabled before host interaction
Ensure clocks are always enabled before any interaction with the host controller driver. This makes sure that there is no race between host execution and the core layer turning off clocks in different context with clock gating framework. Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Per Forlin <per.forlin@stericsson.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/core/sdio_irq.c')
-rw-r--r--drivers/mmc/core/sdio_irq.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/core/sdio_irq.c b/drivers/mmc/core/sdio_irq.c
index 68f81b9..f573e7f 100644
--- a/drivers/mmc/core/sdio_irq.c
+++ b/drivers/mmc/core/sdio_irq.c
@@ -146,15 +146,21 @@ static int sdio_irq_thread(void *_host)
}
set_current_state(TASK_INTERRUPTIBLE);
- if (host->caps & MMC_CAP_SDIO_IRQ)
+ if (host->caps & MMC_CAP_SDIO_IRQ) {
+ mmc_host_clk_hold(host);
host->ops->enable_sdio_irq(host, 1);
+ mmc_host_clk_release(host);
+ }
if (!kthread_should_stop())
schedule_timeout(period);
set_current_state(TASK_RUNNING);
} while (!kthread_should_stop());
- if (host->caps & MMC_CAP_SDIO_IRQ)
+ if (host->caps & MMC_CAP_SDIO_IRQ) {
+ mmc_host_clk_hold(host);
host->ops->enable_sdio_irq(host, 0);
+ mmc_host_clk_release(host);
+ }
pr_debug("%s: IRQ thread exiting with code %d\n",
mmc_hostname(host), ret);
OpenPOWER on IntegriCloud