From 9c123aff46fed97240deb615af50a85331ed129f Mon Sep 17 00:00:00 2001 From: Veerabhadrarao Badiganti Date: Thu, 1 Jun 2017 21:16:14 +0530 Subject: mmc: core: Fix the issue with clock scaling in resume-scaling In resume_scaling, the host current clock is compared with max clock of the card to adjust the current-scaling clock. If max clock supported by the card is more than the max clock that the host can support, then the above-mentioned comparison is resulting in setting the current-scaling clock to scale-down clock frequency even though current host clock is at the maximum clock. This will lead to skipping of scaling down to lower clock in low load use-cases. So clock would remain at max clock till next time clock is scaled up and then scaled down. To prevent this scenario, compare the host current clock with max clock that host can be scaled-up instead of max clock of the card. Change-Id: Ibbed4bb374f1cbb5aee21cfca4e7e97d8f999d51 Signed-off-by: Veerabhadrarao Badiganti --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/mmc') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index c23f3c3ec864..2cb0ea03a338 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -857,7 +857,7 @@ int mmc_resume_clk_scaling(struct mmc_host *host) devfreq_min_clk = host->clk_scaling.freq_table[0]; host->clk_scaling.curr_freq = devfreq_max_clk; - if (host->ios.clock < host->card->clk_scaling_highest) + if (host->ios.clock < host->clk_scaling.freq_table[max_clk_idx]) host->clk_scaling.curr_freq = devfreq_min_clk; host->clk_scaling.clk_scaling_in_progress = false; -- cgit v1.2.3