diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2023-06-14 10:20:20 +0300 |
---|---|---|
committer | Viresh Kumar <viresh.kumar@linaro.org> | 2023-06-14 12:24:01 +0300 |
commit | 04bd2eafee153b9cc4b411d4a24d32b1ec2ce41c (patch) | |
tree | 7aa7e485ea579a36d096caa24c12f6ee1699926e /drivers/opp/of.c | |
parent | 64aaeb708245acdcbe51cf30c84418668c044d80 (diff) | |
download | linux-04bd2eafee153b9cc4b411d4a24d32b1ec2ce41c.tar.xz |
OPP: don't drop performance constraint on OPP table removal
This code was added (long back) by commit 009acd196fc8 ("PM / OPP:
Support updating performance state of device's power domain") and at
that time the `opp->pstate` field was used to store the performance
state required by a device's OPP.
Over time that changed and the `->pstate` field is now used only for
genpd devices and consumer devices access that via the required-opps
instead.
Because of all these changes, _opp_table_kref_release() now drops the
constraint only when the genpd's OPP table gets freed and not the
device's. Which is definitely not what we wanted. And dropping the
constraint doesn't have much meaning as the genpd itself is going away.
Moreover, if we want to drop constraints here, then just dropping the
performance constraint alone isn't sufficient as there are other
resource constraints like clk, regulator, etc. too, which must be
handled.
Probably the right thing to do here is to leave this decision to the
consumers, which can call `dev_pm_opp_set_rate(dev, 0)` or similar APIs
to drop all constraints properly. Which many of the consumers already
do.
Remove the special code, which is broken anyway.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/opp/of.c')
-rw-r--r-- | drivers/opp/of.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/opp/of.c b/drivers/opp/of.c index ac2179d5da4c..943c7fb7402b 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -1034,14 +1034,6 @@ static int _of_add_opp_table_v2(struct device *dev, struct opp_table *opp_table) goto remove_static_opp; } - list_for_each_entry(opp, &opp_table->opp_list, node) { - /* Any non-zero performance state would enable the feature */ - if (opp->pstate) { - opp_table->genpd_performance_state = true; - break; - } - } - lazy_link_required_opp_table(opp_table); return 0; |