From a7a3b1a72d219fd3eb98403c9dfc0ef1fc55ebbd Mon Sep 17 00:00:00 2001 From: Shawn Lin Date: Thu, 5 May 2016 11:03:22 +0800 Subject: [PATCH] mmc: sdhci-of-arasan: fix using sleep function whthin spinlock 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 --- drivers/mmc/host/sdhci-of-arasan.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 426750bed6fa..8e846b28331d 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -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 = { -- 2.34.1