linux_dsm_epyc7002/drivers/macintosh
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
..
ams treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
adb-iop.c macintosh/via-macii, macintosh/adb-iop: Clean up whitespace 2018-10-08 22:53:10 +11:00
adb.c macintosh/adb: Rework printk output again 2018-10-08 22:53:10 +11:00
adbhid.c macintosh/adb: Rework printk output again 2018-10-08 22:53:10 +11:00
ans-lcd.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
ans-lcd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
apm_emu.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 118 2019-05-24 17:39:02 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mac_hid.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
macio_asic.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
macio_sysfs.c macintosh: Use device_type helpers to access the node type 2018-11-26 22:33:37 +11:00
macio-adb.c macintosh/adb: Use C99 initializers for struct adb_driver instances 2018-03-31 00:10:32 +11:00
Makefile macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver 2018-07-31 19:56:42 +10:00
mediabay.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rack-meter.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
smu.c drivers/macintosh/smu.c: Mark expected switch fall-through 2019-07-31 21:44:45 +10:00
therm_adt746x.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
therm_windtunnel.c macintosh: therm_windtunnel: drop using attach_adapter 2018-08-24 14:42:42 +02:00
via-cuda.c macintosh/via-cuda: Don't rely on Cuda to end a transfer 2019-01-22 10:21:45 +01:00
via-macii.c macintosh/via-macii, macintosh/adb-iop: Clean up whitespace 2018-10-08 22:53:10 +11:00
via-pmu-backlight.c backlight: Fix old-style function definition 2018-01-21 23:37:44 +11:00
via-pmu-event.c
via-pmu-event.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
via-pmu-led.c
via-pmu.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
windfarm_ad7417_sensor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_core.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_cpufreq_clamp.c cpufreq: Use per-policy frequency QoS 2019-10-21 02:05:21 +02:00
windfarm_fcu_controls.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_lm75_sensor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_lm87_sensor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_max6690_sensor.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
windfarm_mpu.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_pid.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_pid.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_pm72.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
windfarm_pm81.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_pm91.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_pm112.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
windfarm_pm121.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_rm31.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 247 2019-06-19 17:09:08 +02:00
windfarm_smu_controls.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm_smu_sat.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 375 2019-06-05 17:37:10 +02:00
windfarm_smu_sensors.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00
windfarm.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 246 2019-06-19 17:09:08 +02:00