aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDong Aisheng <b29396@freescale.com>2013-12-16 01:42:14 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:47:29 -0400
commite2ff3a65d3cb87b4a1f443fec4309f6663f96380 (patch)
tree2cce21a486f73d6948d40869db06c1e291f6a8f2
parent10f6b42056dffe2f73a6ff486770b9df08949c0d (diff)
ENGR00292140 mmc: sdhci: fix possible sleep in atomic in sdio_irq enable function
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>
-rw-r--r--drivers/mmc/host/sdhci.c12
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)
1697 1697
1698static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) 1698static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable)
1699{ 1699{
1700 if (enable)
1701 sdhci_runtime_pm_get(host);
1702
1703 if (host->flags & SDHCI_DEVICE_DEAD) 1700 if (host->flags & SDHCI_DEVICE_DEAD)
1704 goto out; 1701 goto out;
1705 1702
@@ -1718,9 +1715,6 @@ static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable)
1718 sdhci_mask_irqs(host, SDHCI_INT_CARD_INT); 1715 sdhci_mask_irqs(host, SDHCI_INT_CARD_INT);
1719out: 1716out:
1720 mmiowb(); 1717 mmiowb();
1721
1722 if (!enable)
1723 sdhci_runtime_pm_put(host);
1724} 1718}
1725 1719
1726static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) 1720static 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)
1728 struct sdhci_host *host = mmc_priv(mmc); 1722 struct sdhci_host *host = mmc_priv(mmc);
1729 unsigned long flags; 1723 unsigned long flags;
1730 1724
1725 if (enable)
1726 sdhci_runtime_pm_get(host);
1727
1731 spin_lock_irqsave(&host->lock, flags); 1728 spin_lock_irqsave(&host->lock, flags);
1732 sdhci_enable_sdio_irq_nolock(host, enable); 1729 sdhci_enable_sdio_irq_nolock(host, enable);
1733 spin_unlock_irqrestore(&host->lock, flags); 1730 spin_unlock_irqrestore(&host->lock, flags);
1731
1732 if (!enable)
1733 sdhci_runtime_pm_put(host);
1734} 1734}
1735 1735
1736static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, 1736static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,