Commit a5663c9b authored by Viresh Kumar's avatar Viresh Kumar

opp: Allow opp-level to be set to 0

The DT bindings don't put such a constraint, nor should the kernel. It
is perfectly fine for opp-level to be set to 0, if we need to put the
performance state votes for a domain for a particular OPP.
Reported-by: default avatarStephan Gerhold <stephan@gerhold.net>
Tested-by: default avatarStephan Gerhold <stephan@gerhold.net>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent cb60e960
...@@ -2109,9 +2109,6 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table, ...@@ -2109,9 +2109,6 @@ int dev_pm_opp_xlate_performance_state(struct opp_table *src_table,
int dest_pstate = -EINVAL; int dest_pstate = -EINVAL;
int i; int i;
if (!pstate)
return 0;
/* /*
* Normally the src_table will have the "required_opps" property set to * Normally the src_table will have the "required_opps" property set to
* point to one of the OPPs in the dst_table, but in some cases the * point to one of the OPPs in the dst_table, but in some cases the
......
...@@ -842,7 +842,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, ...@@ -842,7 +842,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table) static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
{ {
struct device_node *np; struct device_node *np;
int ret, count = 0, pstate_count = 0; int ret, count = 0;
struct dev_pm_opp *opp; struct dev_pm_opp *opp;
/* OPP table is already initialized for the device */ /* OPP table is already initialized for the device */
...@@ -876,20 +876,14 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table) ...@@ -876,20 +876,14 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table)
goto remove_static_opp; goto remove_static_opp;
} }
list_for_each_entry(opp, &opp_table->opp_list, node) list_for_each_entry(opp, &opp_table->opp_list, node) {
pstate_count += !!opp->pstate; /* Any non-zero performance state would enable the feature */
if (opp->pstate) {
/* Either all or none of the nodes shall have performance state set */ opp_table->genpd_performance_state = true;
if (pstate_count && pstate_count != count) { break;
dev_err(dev, "Not all nodes have performance state set (%d: %d)\n", }
count, pstate_count);
ret = -ENOENT;
goto remove_static_opp;
} }
if (pstate_count)
opp_table->genpd_performance_state = true;
return 0; return 0;
remove_static_opp: remove_static_opp:
......
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