mmc: sdhci-of-arasan: fix using sleep function whthin spinlock
authorShawn Lin <shawn.lin@rock-chips.com>
Thu, 5 May 2016 03:03:22 +0000 (11:03 +0800)
committerGerrit Code Review <gerrit@rock-chips.com>
Thu, 5 May 2016 06:47:31 +0000 (14:47 +0800)
Let's use unlock/lock around phy APIs as them will call
mutex which is sleepable casuing failure of kernel debug
check.

Change-Id: Ic7670bfc9ed763cc9bdec53f85f553bc0be1416c
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
drivers/mmc/host/sdhci-of-arasan.c

index 426750bed6fa3b321d1aa2c166b662ee40f7839e..8e846b28331d17d0f447465f92f571e5812e8315 100644 (file)
@@ -83,13 +83,19 @@ static void sdhci_arasan_set_clock(struct sdhci_host *host, unsigned int clock)
        if (clock > MMC_HIGH_52_MAX_DTR && (!IS_ERR(sdhci_arasan->phy)))
                ctrl_phy = true;
 
-       if (ctrl_phy)
+       if (ctrl_phy) {
+               spin_unlock_irq(&host->lock);
                phy_power_off(sdhci_arasan->phy);
+               spin_lock_irq(&host->lock);
+       }
 
        sdhci_set_clock(host, clock);
 
-       if (ctrl_phy)
+       if (ctrl_phy) {
+               spin_unlock_irq(&host->lock);
                phy_power_on(sdhci_arasan->phy);
+               spin_lock_irq(&host->lock);
+       }
 }
 
 static struct sdhci_ops sdhci_arasan_ops = {