Skip to content

Commit

Permalink
opp: Filter out OPPs based on availability of a required-OPP
Browse files Browse the repository at this point in the history
A required OPP may not be available, and thus, all OPPs which are using
this required OPP should be unavailable too.

Tested-by: Peter Geis <[email protected]>
Tested-by: Nicolas Chauvet <[email protected]>
Tested-by: Matt Merhar <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
  • Loading branch information
digetx authored and vireshk committed Feb 2, 2021
1 parent 32715be commit cf65948
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/opp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 list_head *head;
unsigned int i;
int ret;

mutex_lock(&opp_table->lock);
Expand All @@ -1547,6 +1548,16 @@ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp,
__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;
}

Expand Down

0 comments on commit cf65948

Please sign in to comment.