summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2013-11-15 17:54:36 +0800
committerDong Aisheng <aisheng.dong@nxp.com>2016-02-16 18:02:44 +0800
commite616a482bad2a2d4193d4890c6ad78ec3685d3e9 (patch)
tree9bf7156287afa8be9f8593165038c3d0d20cb8ad /drivers
parente9436ad124d83edcd70dbc4cf6fb6a1b892a0d4d (diff)
MLK-12360-2 mmc: sdhci: get runtime pm when sdio irq is enabled
SDIO cards may need clock to send the card interrupt to host. Thus, we get runtime pm when sdio irq is enabled to prevent the clock resource is released and put it when sdio irq is disabled. This patch can allow sdio irq disable (mmc_signal_sdio_irq()) to be called in interrupt context due to sdhci_runtime_pm_put() is atomic safe. Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com> (cherry picked from commit 250899a9ca2fdb31fc8d9d5405ac7b1c86beef44)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index fd4bf172aba3..1565855b868d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1720,7 +1720,8 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
struct sdhci_host *host = mmc_priv(mmc);
unsigned long flags;
- sdhci_runtime_pm_get(host);
+ if (enable)
+ sdhci_runtime_pm_get(host);
spin_lock_irqsave(&host->lock, flags);
if (enable)
@@ -1731,7 +1732,8 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable)
sdhci_enable_sdio_irq_nolock(host, enable);
spin_unlock_irqrestore(&host->lock, flags);
- sdhci_runtime_pm_put(host);
+ if (!enable)
+ sdhci_runtime_pm_put(host);
}
static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,