From c328d924ab502c01b58c6849474ce242b2c6a873 Mon Sep 17 00:00:00 2001 From: Talel Shenhar Date: Tue, 14 Jul 2015 11:30:15 +0300 Subject: [PATCH] mmc: core: disable clock scaling before system suspend This change disables clock scaling in PM notification for "prepare for system suspend". This is needed because devfreq creates a dependency between it and mmc which causes an issue for system suspend. In this change we break this dependency in earlier stage. Change-Id: I86dad94c77607b4e8f8fa67035323716f5eb197d Signed-off-by: Talel Shenhar --- drivers/mmc/core/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 31f1822de554..45971ef9b74e 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -289,7 +289,8 @@ bool mmc_can_scale_clk(struct mmc_host *host) return false; } - return host->caps2 & MMC_CAP2_CLK_SCALE; + return (host->caps2 & MMC_CAP2_CLK_SCALE) && + (!(host->pm_flags & MMC_PM_IGNORE_PM_NOTIFY)); } EXPORT_SYMBOL(mmc_can_scale_clk); @@ -747,7 +748,7 @@ int mmc_exit_clk_scaling(struct mmc_host *host) return -EINVAL; } - if (!mmc_can_scale_clk(host)) + if (!mmc_can_scale_clk(host) || !host->clk_scaling.enable) return 0; if (!host->clk_scaling.devfreq) { @@ -4155,6 +4156,7 @@ int mmc_pm_notify(struct notifier_block *notify_block, spin_unlock_irqrestore(&host->lock, flags); cancel_delayed_work_sync(&host->detect); + mmc_disable_clk_scaling(host); if (!host->bus_ops) break;