summaryrefslogtreecommitdiff
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 07:56:26 +0300
commit32715be4fe95fc98762959f8dff6f9f8a39df28f (patch)
tree1ba2e8e867dbd8b787e467e06c3976b555440063 /drivers/opp
parent1048ba83fb1c00cd24172e23e8263972f6b5d9ac (diff)
downloadlinux-32715be4fe95fc98762959f8dff6f9f8a39df28f.tar.xz
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);