]> asedeno.scripts.mit.edu Git - linux.git/commit
cpufreq: dt: Try freeing static OPPs only if we have added them
authorViresh Kumar <viresh.kumar@linaro.org>
Wed, 3 Oct 2018 10:05:21 +0000 (15:35 +0530)
committerViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Oct 2018 03:41:38 +0000 (09:11 +0530)
commit51c99dd2c06b234575661fa1e0a1dea6c3ef566f
tree82c8945cbf9a7d5149f4b521716deaf424e6877e
parent09f662f95306f3e3d47ab6842bc4b0bb868a80ad
cpufreq: dt: Try freeing static OPPs only if we have added them

We can not call dev_pm_opp_of_cpumask_remove_table() freely anymore
since the latest OPP core updates as that uses reference counting to
free resources. There are cases where no static OPPs are added (using
DT) for a platform and trying to remove the OPP table may end up
decrementing refcount which is already zero and hence generating
warnings.

Lets track if we were able to add static OPPs or not and then only
remove the table based on that. Some reshuffling of code is also done to
do that.

Reported-by: Niklas Cassel <niklas.cassel@linaro.org>
Tested-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/cpufreq-dt.c