From efed7cade758544402b672bd25269902b3bb24a3 Mon Sep 17 00:00:00 2001 From: Ziqi Chen Date: Wed, 26 Aug 2020 14:16:17 +0800 Subject: [PATCH] mmc: core: Fix issue of no clk scaling upon previous scaling failure If the current partition type is RPMB, clock switching may not work properly. In this case, clk scaling up would be skipped but clk_scaling->target_freq has been changed and then discard sub- sequent clk scaling up requests till meet scaling down. Changing judgement condition clk_scaling->target_freq == *freq to clk_scaling ->curr_freq == *freq in mmc_devfreq_set_target to avoid this issue. Change-Id: Id0636e7c792c63156597d5db4e9087bd5fdc2621 Signed-off-by: Ziqi Chen --- drivers/mmc/core/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 4ef30120be4d..412a81fdf3ad 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -515,7 +515,7 @@ static int mmc_devfreq_set_target(struct device *dev, *freq, current->comm); spin_lock_bh(&clk_scaling->lock); - if (clk_scaling->target_freq == *freq || + if (clk_scaling->curr_freq == *freq || clk_scaling->skip_clk_scale_freq_update) { spin_unlock_bh(&clk_scaling->lock); goto out;