linux-stable/drivers/cpufreq
Viresh Kumar 36cce138ca cpufreq: dt: Try freeing static OPPs only if we have added them
[ Upstream commit 51c99dd2c0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13 11:16:50 -08:00
..
Kconfig cpufreq: Add Loongson machine dependencies 2018-02-03 17:05:36 +01:00
Kconfig.arm cpufreq: CPPC: add ACPI_PROCESSOR dependency 2017-10-21 17:21:38 +02:00
Kconfig.powerpc cpufreq: qoriq: rename the driver 2015-03-18 22:35:16 +01:00
Kconfig.x86 cpufreq: intel_pstate: Enforce _PPC limits 2016-04-28 01:01:39 +02:00
Makefile Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2016-05-19 10:02:26 -07:00
acpi-cpufreq.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
amd_freq_sensitivity.c cpufreq: Reuse new freq-table helpers 2016-07-07 00:14:27 +02:00
arm_big_little.c cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table 2016-05-05 01:40:04 +02:00
arm_big_little.h cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table 2016-05-05 01:40:04 +02:00
arm_big_little_dt.c cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table 2016-05-05 01:40:04 +02:00
at32ap-cpufreq.c
blackfin-cpufreq.c blackfin-cpufreq: Mark cpu_set_cclk() as static 2015-12-28 01:51:36 +01:00
cppc_cpufreq.c cpufreq: cppc_cpufreq: Fix cppc_cpufreq_init() failure path 2018-05-30 07:50:44 +02:00
cpufreq-dt-platdev.c cpufreq: ti: Use generic platdev driver 2016-09-16 23:57:04 +02:00
cpufreq-dt.c cpufreq: dt: Try freeing static OPPs only if we have added them 2018-11-13 11:16:50 -08:00
cpufreq-dt.h cpufreq: dt: Support governor tunables per policy 2016-09-13 02:39:12 +02:00
cpufreq-nforce2.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
cpufreq.c sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
cpufreq_conservative.c cpufreq: conservative: Allow down_threshold to take values from 1 to 10 2017-06-24 07:11:12 +02:00
cpufreq_governor.c sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
cpufreq_governor.h cpufreq: Drop the 'initialized' field from struct cpufreq_governor 2016-06-02 23:24:39 +02:00
cpufreq_governor_attr_set.c cpufreq: governor: Move abstract gov_attr_set code to seperate file 2016-04-02 01:09:01 +02:00
cpufreq_ondemand.c cpufreq: Reuse new freq-table helpers 2016-07-07 00:14:27 +02:00
cpufreq_ondemand.h cpufreq: ondemand: Don't keep a copy of freq_table pointer 2016-06-09 00:58:06 +02:00
cpufreq_performance.c cpufreq: governor: Get rid of governor events 2016-06-02 23:24:15 +02:00
cpufreq_powersave.c cpufreq: governor: Get rid of governor events 2016-06-02 23:24:15 +02:00
cpufreq_stats.c sched/cputime: Convert kcpustat to nsecs 2018-10-20 09:51:32 +02:00
cpufreq_userspace.c cpufreq: governor: Get rid of governor events 2016-06-02 23:24:15 +02:00
cris-artpec3-cpufreq.c
cris-etraxfs-cpufreq.c
davinci-cpufreq.c cpufreq: davinci: Reuse cpufreq_generic_frequency_table_verify() 2016-06-09 00:58:07 +02:00
dbx500-cpufreq.c
e_powersaver.c cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built-in or module 2016-04-27 22:42:34 +02:00
elanfreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
exynos5440-cpufreq.c PM / OPP: Prefix exported opp routines with dev_pm_opp_ 2015-09-15 02:03:16 +02:00
freq_table.c cpufreq: Handle sorted frequency tables more efficiently 2016-07-07 00:13:20 +02:00
gx-suspmod.c cpufreq: gx-suspmod: Fix two typos in two comments 2015-06-15 15:46:15 +02:00
highbank-cpufreq.c
ia64-acpi-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
imx6q-cpufreq.c Merge branch 'pm-opp' 2015-11-02 00:54:37 +01:00
integrator-cpufreq.c cpufreq: integrator: Fix module autoload for OF platform driver 2015-09-25 23:29:35 +02:00
intel_pstate.c cpufreq: intel_pstate: Update pid_params.sample_rate_ns in pid_param_set() 2017-10-08 10:26:10 +02:00
kirkwood-cpufreq.c cpufreq: kirkwood: add missing \n to end of dev_err messages 2016-09-26 15:10:58 +02:00
longhaul.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
longhaul.h
longrun.c
loongson1-cpufreq.c CPUFREQ: Loongson1: Replace goto out with return in ls1x_cpufreq_probe() 2016-05-13 14:02:08 +02:00
loongson2_cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
maple-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
mt8173-cpufreq.c Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2016-05-26 09:23:43 -07:00
mvebu-cpufreq.c cpufreq: mvebu: fix integer to pointer cast 2016-06-13 23:49:43 +02:00
omap-cpufreq.c remove lots of IS_ERR_VALUE abuses 2016-05-27 15:26:11 -07:00
p4-clockmod.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
pasemi-cpufreq.c
pcc-cpufreq.c Revert "cpufreq: pcc-cpufreq: update default value of cpuinfo_transition_latency" 2016-07-22 23:51:06 +02:00
pmac32-cpufreq.c powerpc updates for 4.7 2016-05-20 10:12:41 -07:00
pmac64-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
powernow-k6.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
powernow-k7.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
powernow-k7.h
powernow-k8.c ACPI / processor: Drop an unused argument of a cleanup routine 2015-07-22 22:11:16 +02:00
powernow-k8.h
powernv-cpufreq.c cpufreq: powernv: Fix hardlockup due to synchronous smp_call in timer interrupt 2018-05-01 15:13:09 -07:00
ppc_cbe_cpufreq.c
ppc_cbe_cpufreq.h cpufreq: e_powersaver: Use IS_ENABLED() instead of checking for built-in or module 2016-04-27 22:42:34 +02:00
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c cpufreq: Remove cpufreq_frequency_get_table() 2016-06-09 00:58:05 +02:00
pxa2xx-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
pxa3xx-cpufreq.c
qoriq-cpufreq.c cpufreq: qoriq: Fix cooling device registration issue during suspend 2016-04-25 16:07:02 +02:00
s3c24xx-cpufreq-debugfs.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s3c24xx-cpufreq.c cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() 2018-03-11 16:21:28 +01:00
s3c64xx-cpufreq.c
s3c2410-cpufreq.c
s3c2412-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s3c2416-cpufreq.c cpufreq: s3c2416: double free on driver init error path 2017-07-05 14:40:30 +02:00
s3c2440-cpufreq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
s5pv210-cpufreq.c ARM: SoC driver updates for v4.8 2016-08-01 18:36:01 -04:00
sa1100-cpufreq.c
sa1110-cpufreq.c ARM: sa1100: move StrongARM CPU ID checks to cputype.h 2016-08-23 10:25:17 +01:00
sc520_freq.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
scpi-cpufreq.c cpufreq-SCPI: Delete unnecessary assignment for the field "owner" 2016-08-18 03:42:32 +02:00
sfi-cpufreq.c cpufreq: sfi: use kmemdup rather than duplicating its implementation 2015-09-01 15:51:15 +02:00
sh-cpufreq.c cpufreq/sh: Replace racy task affinity logic 2018-03-24 11:00:10 +01:00
sparc-us2e-cpufreq.c
sparc-us3-cpufreq.c
spear-cpufreq.c
speedstep-centrino.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
speedstep-ich.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
speedstep-lib.c x86/cpu: Rename cpu_data.x86_mask to cpu_data.x86_stepping 2018-02-22 15:43:55 +01:00
speedstep-lib.h
speedstep-smi.c cpufreq: Use consistent prefixing via pr_fmt 2016-04-09 01:35:18 +02:00
sti-cpufreq.c cpufreq: st: add missing \n to end of dev_err message 2016-09-26 15:11:42 +02:00
tegra20-cpufreq.c cpufreq: tegra20: remove superfluous CONFIG_PM ifdefs 2015-09-26 03:00:57 +02:00
tegra124-cpufreq.c cpufreq: tegra124: No need of setting platform-data 2016-04-09 01:12:09 +02:00
unicore2-cpufreq.c
vexpress-spc-cpufreq.c cpufreq: arm_big_little: use generic OPP functions for {init, free}_opp_table 2016-05-05 01:40:04 +02:00