alistair23-linux/drivers/thermal
Rafael J. Wysocki 3000ce3c52 cpufreq: Use per-policy frequency QoS
Replace the CPU device PM QoS used for the management of min and max
frequency constraints in cpufreq (and its users) with per-policy
frequency QoS to avoid problems with cpufreq policies covering
more then one CPU.

Namely, a cpufreq driver is registered with the subsys interface
which calls cpufreq_add_dev() for each CPU, starting from CPU0, so
currently the PM QoS notifiers are added to the first CPU in the
policy (i.e. CPU0 in the majority of cases).

In turn, when the cpufreq driver is unregistered, the subsys interface
doing that calls cpufreq_remove_dev() for each CPU, starting from CPU0,
and the PM QoS notifiers are only removed when cpufreq_remove_dev() is
called for the last CPU in the policy, say CPUx, which as a rule is
not CPU0 if the policy covers more than one CPU.  Then, the PM QoS
notifiers cannot be removed, because CPUx does not have them, and
they are still there in the device PM QoS notifiers list of CPU0,
which prevents new PM QoS notifiers from being registered for CPU0
on the next attempt to register the cpufreq driver.

The same issue occurs when the first CPU in the policy goes offline
before unregistering the driver.

After this change it does not matter which CPU is the policy CPU at
the driver registration time and whether or not it is online all the
time, because the frequency QoS is per policy and not per CPU.

Fixes: 67d874c3b2 ("cpufreq: Register notifiers with the PM QoS framework")
Reported-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Reported-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Sudeep Holla <sudeep.holla@arm.com>
Diagnosed-by: Viresh Kumar <viresh.kumar@linaro.org>
Link: https://lore.kernel.org/linux-pm/5ad2624194baa2f53acc1f1e627eb7684c577a19.1562210705.git.viresh.kumar@linaro.org/T/#md2d89e95906b8c91c15f582146173dce2e86e99f
Link: https://lore.kernel.org/linux-pm/20191017094612.6tbkwoq4harsjcqv@vireshk-i7/T/#m30d48cc23b9a80467fbaa16e30f90b3828a5a29b
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
2019-10-21 02:05:21 +02:00
..
broadcom Driver Core and debugfs changes for 5.3-rc1 2019-07-12 12:24:03 -07:00
intel Merge branch 'for-5.4' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2019-09-27 11:35:13 -07:00
qcom drivers: thermal: qcom: tsens: Fix memory leak from qfprom read 2019-08-28 21:05:08 +08:00
samsung
st
tegra thermal: tegra: Fix a typo 2019-08-28 17:56:45 +08:00
ti-soc-thermal
armada_thermal.c thermal: armada: Fix -Wshift-negative-value 2019-08-28 16:41:02 +08:00
clock_cooling.c
cpu_cooling.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
da9062-thermal.c
db8500_thermal.c thermal: db8500: Rewrite to be a pure OF sensor 2019-09-24 22:59:22 -07:00
devfreq_cooling.c
dove_thermal.c
fair_share.c thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
gov_bang_bang.c thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
hisi_thermal.c
imx_thermal.c
Kconfig thermal: db8500: Finalize device tree conversion 2019-09-24 22:54:49 -07:00
kirkwood_thermal.c
Makefile
max77620_thermal.c
mtk_thermal.c
of-thermal.c
power_allocator.c thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
qoriq_thermal.c thermal: qoriq: Use __maybe_unused instead of #if CONFIG_PM_SLEEP 2019-08-28 16:33:27 +08:00
rcar_gen3_thermal.c thermal: rcar_gen3_thermal: Replace devm_add_action() followed by failure action with devm_add_action_or_reset() 2019-08-28 17:51:26 +08:00
rcar_thermal.c
rockchip_thermal.c
spear_thermal.c
step_wise.c thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
tango_thermal.c
thermal-generic-adc.c
thermal_core.c thermal: Add some error messages 2019-09-24 09:56:08 +08:00
thermal_core.h thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
thermal_helpers.c
thermal_hwmon.c thermal_hwmon: Sanitize thermal_zone type 2019-09-24 09:56:08 +08:00
thermal_hwmon.h
thermal_mmio.c thermal: thermal_mmio: remove some dead code 2019-09-22 13:44:52 -07:00
thermal_sysfs.c
uniphier_thermal.c
user_space.c thermal/drivers/core: Use governor table to initialize 2019-06-27 21:22:14 +08:00
zx2967_thermal.c