diff options
author | Dong Aisheng <b29396@freescale.com> | 2013-12-16 14:42:14 +0800 |
---|---|---|
committer | Dong Aisheng <b29396@freescale.com> | 2013-12-16 14:57:56 +0800 |
commit | ec1af9f898d234001d8fc7d720382de34cb6580f (patch) | |
tree | e185dfe5b7819ff09f5250c884ae5862f16c24ad /drivers/mmc/host/sdhci.c | |
parent | 533751d6177c63ca28081036644406a03f2ce55b (diff) |
ENGR00292140 mmc: sdhci: fix possible sleep in atomic in sdio_irq enable functionrel_imx_3.10.17_1.0.0_beta
The sdhci_runtime_pm_get API is able to sleep, so should not call it in
sdhci_enable_sdio_irq_nolock which is executed with spin_lock_irqsave in
sdhci_enable_sdio_irq.
Move it out of spin lock to fix this issue.
Signed-off-by: Dong Aisheng <b29396@freescale.com>
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r-- | drivers/mmc/host/sdhci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7b008675d7fc..dfa71b32c8e0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1697,9 +1697,6 @@ static int sdhci_get_ro(struct mmc_host *mmc) static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) { - if (enable) - sdhci_runtime_pm_get(host); - if (host->flags & SDHCI_DEVICE_DEAD) goto out; @@ -1718,9 +1715,6 @@ static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) sdhci_mask_irqs(host, SDHCI_INT_CARD_INT); out: mmiowb(); - - if (!enable) - sdhci_runtime_pm_put(host); } static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) @@ -1728,9 +1722,15 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; + if (enable) + sdhci_runtime_pm_get(host); + spin_lock_irqsave(&host->lock, flags); sdhci_enable_sdio_irq_nolock(host, enable); spin_unlock_irqrestore(&host->lock, flags); + + if (!enable) + sdhci_runtime_pm_put(host); } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, |