aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/opp
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2021-01-18 03:55:13 +0300
committerViresh Kumar <viresh.kumar@linaro.org>2021-02-02 10:26:26 +0530
commit32715be4fe95fc98762959f8dff6f9f8a39df28f (patch)
tree1ba2e8e867dbd8b787e467e06c3976b555440063 /drivers/opp
parentLinux 5.11-rc6 (diff)
downloadlinux-dev-32715be4fe95fc98762959f8dff6f9f8a39df28f.tar.xz
linux-dev-32715be4fe95fc98762959f8dff6f9f8a39df28f.zip
opp: Fix adding OPP entries in a wrong order if rate is unavailable
Fix adding OPP entries in a wrong (opposite) order if OPP rate is unavailable. The OPP comparison was erroneously skipped, thus OPPs were left unsorted. Tested-by: Peter Geis <pgwipeout@gmail.com> Tested-by: Nicolas Chauvet <kwizart@gmail.com> Tested-by: Matt Merhar <mattmerhar@protonmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/opp')
-rw-r--r--drivers/opp/core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index 8c905aabacc0..5793c833b86a 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -1527,12 +1527,10 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
mutex_lock(&opp_table->lock);
head = &opp_table->opp_list;
- if (likely(!rate_not_available)) {
- ret = _opp_is_duplicate(dev, new_opp, opp_table, &head);
- if (ret) {
- mutex_unlock(&opp_table->lock);
- return ret;
- }
+ ret = _opp_is_duplicate(dev, new_opp, opp_table, &head);
+ if (ret) {
+ mutex_unlock(&opp_table->lock);
+ return ret;
}
list_add(&new_opp->node, head);