Commit cf65948d authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Viresh Kumar

opp: Filter out OPPs based on availability of a required-OPP

A required OPP may not be available, and thus, all OPPs which are using
this required OPP should be unavailable too.
Tested-by: default avatarPeter Geis <pgwipeout@gmail.com>
Tested-by: default avatarNicolas Chauvet <kwizart@gmail.com>
Tested-by: default avatarMatt Merhar <mattmerhar@protonmail.com>
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 32715be4
...@@ -1522,6 +1522,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, ...@@ -1522,6 +1522,7 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
struct opp_table *opp_table, bool rate_not_available) struct opp_table *opp_table, bool rate_not_available)
{ {
struct list_head *head; struct list_head *head;
unsigned int i;
int ret; int ret;
mutex_lock(&opp_table->lock); mutex_lock(&opp_table->lock);
...@@ -1547,6 +1548,16 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, ...@@ -1547,6 +1548,16 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
__func__, new_opp->rate); __func__, new_opp->rate);
} }
for (i = 0; i < opp_table->required_opp_count; i++) {
if (new_opp->required_opps[i]->available)
continue;
new_opp->available = false;
dev_warn(dev, "%s: OPP not supported by required OPP %pOF (%lu)\n",
__func__, new_opp->required_opps[i]->np, new_opp->rate);
break;
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment