linux-stable/drivers/cpufreq
Viresh Kumar 50bd749c60 cpufreq: Don't unregister cpufreq cooling on CPU hotplug
[ Upstream commit c4d61a529d ]

Offlining a CPU and bringing it back online is a common operation and it
happens frequently during system suspend/resume, where the non-boot CPUs
are hotplugged out during suspend and brought back at resume.

The cpufreq core already tries to make this path as fast as possible as
the changes are only temporary in nature and full cleanup of resources
isn't required in this case. For example the drivers can implement
online()/offline() callbacks to avoid a lot of tear down of resources.

On similar lines, there is no need to unregister the cpufreq cooling
device during suspend / resume, but only while the policy is getting
removed.

Moreover, unregistering the cpufreq cooling device is resulting in an
unwanted outcome, where the system suspend is eventually aborted in the
process.  Currently, during system suspend the cpufreq core unregisters
the cooling device, which in turn removes a kobject using device_del()
and that generates a notification to the userspace via uevent broadcast.
This causes system suspend to abort in some setups.

This was also earlier reported (indirectly) by Roman [1]. Maybe there is
another way around to fixing that problem properly, but this change
makes sense anyways.

Move the registering and unregistering of the cooling device to policy
creation and removal times onlyy.

Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218521
Reported-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
Reported-by: Roman Stratiienko <r.stratiienko@gmail.com>
Link: https://patchwork.kernel.org/project/linux-pm/patch/20220710164026.541466-1-r.stratiienko@gmail.com/ [1]
Tested-by: Manaf Meethalavalappu Pallikunhi <quic_manafm@quicinc.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:05:00 +02:00
..
Kconfig cpufreq: loongson2: fix Kconfig "its" grammar 2022-07-25 20:34:56 +02:00
Kconfig.arm nvmem: prefix all symbols with NVMEM_ 2022-09-24 14:54:38 +02:00
Kconfig.powerpc
Kconfig.x86 cpufreq: amd-pstate: change amd-pstate driver to be built-in type 2022-11-22 19:57:15 +01:00
Makefile cpufreq: amd-pstate: Add test module for amd-pstate driver 2022-10-05 11:05:17 -06:00
acpi-cpufreq.c cpufreq: ACPI: Add Zhaoxin/Centaur turbo boost control interface support 2022-06-29 20:14:39 +02:00
amd-pstate-trace.c cpufreq: amd-pstate: Add trace for AMD P-State module 2021-12-30 18:51:39 +01:00
amd-pstate-trace.h cpufreq: amd-pstate: Add more tracepoint for AMD P-State module 2022-03-09 19:53:01 +01:00
amd-pstate-ut.c cpufreq: amd-pstate-ut: Fix kernel panic when loading the driver 2023-09-13 09:42:29 +02:00
amd-pstate.c cpufreq: amd-pstate: Fix min_perf assignment in amd_pstate_adjust_perf() 2024-04-03 15:19:25 +02:00
amd_freq_sensitivity.c cpufreq: amd_freq_sensitivity: Add missing pci_dev_put() 2022-12-31 13:31:58 +01:00
armada-8k-cpufreq.c cpufreq: ap806: Add missing MODULE_DEVICE_TABLE 2020-12-07 13:02:37 +05:30
armada-37xx-cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
bmips-cpufreq.c cpufreq: bmips-cpufreq: Use module_init and add module_exit 2022-08-30 13:49:23 +05:30
brcmstb-avs-cpufreq.c cpufreq: brcmstb-avs-cpufreq: fix up "add check for cpufreq_cpu_get's return value" 2024-04-03 15:19:39 +02:00
cppc_cpufreq.c cpufreq: CPPC: Add u64 casts to avoid overflowing 2023-02-01 08:34:28 +01:00
cpufreq-dt-platdev.c cpufreq: Use of_property_present() for testing DT property presence 2024-01-25 15:27:20 -08:00
cpufreq-dt.c cpufreq: dt: always allocate zeroed cpumask 2024-04-03 15:19:37 +02:00
cpufreq-dt.h
cpufreq-nforce2.c
cpufreq.c cpufreq: Don't unregister cpufreq cooling on CPU hotplug 2024-04-13 13:05:00 +02:00
cpufreq_conservative.c cpufreq: unify show() and store() naming and use __ATTR_XX 2022-03-10 19:55:05 +01:00
cpufreq_governor.c cpufreq: governor: Use kobject release() method to free dbs_data 2022-04-13 15:22:41 +02:00
cpufreq_governor.h cpufreq: governor: Use kobject release() method to free dbs_data 2022-04-13 15:22:41 +02:00
cpufreq_governor_attr_set.c cpufreq: Move to_gov_attr_set() to cpufreq.h 2022-02-04 19:22:34 +01:00
cpufreq_ondemand.c cpufreq: ondemand: Use cpumask_var_t for on-stack cpu mask 2022-07-25 20:38:01 +02:00
cpufreq_ondemand.h
cpufreq_performance.c
cpufreq_powersave.c
cpufreq_stats.c cpufreq: stats: Fix buffer overflow detection in trans_stats() 2023-11-28 17:07:16 +00:00
cpufreq_userspace.c
davinci-cpufreq.c cpufreq: davinci: Fix clk use after free 2023-03-10 09:33:01 +01:00
e_powersaver.c
elanfreq.c
freq_table.c cpufreq: Fix scaling_{available,boost}_frequencies_show() comments 2021-03-26 17:43:48 +01:00
gx-suspmod.c
highbank-cpufreq.c cpufreq: Add __init annotation to module init funcs 2022-09-26 11:15:04 +05:30
ia64-acpi-cpufreq.c ia64: fix format string for ia64-acpi-cpu-freq 2021-03-19 17:26:20 +01:00
imx-cpufreq-dt.c cpufreq: Use of_property_present() for testing DT property presence 2024-01-25 15:27:20 -08:00
imx6q-cpufreq.c cpufreq: Use of_property_present() for testing DT property presence 2024-01-25 15:27:20 -08:00
intel_pstate.c cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back 2024-03-06 14:45:06 +00:00
kirkwood-cpufreq.c
longhaul.c cpufreq: longhaul: Replace acpi_bus_get_device() 2022-02-04 19:31:49 +01:00
longhaul.h
longrun.c
loongson1-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
loongson2_cpufreq.c cpufreq: loongson2: Remove unused linux/sched.h headers 2021-06-07 17:43:52 +02:00
maple-cpufreq.c
mediatek-cpufreq-hw.c cpufreq: mediatek-hw: Don't error out if supply is not found 2024-03-26 18:20:32 -04:00
mediatek-cpufreq.c cpufreq: mediatek: correct voltages for MT7622 and MT7623 2023-07-19 16:21:58 +02:00
mvebu-cpufreq.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
omap-cpufreq.c cpufreq: omap: Use .register_em() to register with energy model 2021-08-12 09:54:07 +05:30
p4-clockmod.c
pasemi-cpufreq.c cpufreq: Prepare cleanup of powerpc's asm/prom.h 2022-04-13 17:18:45 +02:00
pcc-cpufreq.c
pmac32-cpufreq.c cpufreq: pmac32-cpufreq: Fix refcount leak bug 2022-06-28 13:34:51 +05:30
pmac64-cpufreq.c cpufreq: Prepare cleanup of powerpc's asm/prom.h 2022-04-13 17:18:45 +02:00
powernow-k6.c
powernow-k7.c
powernow-k7.h
powernow-k8.c cpufreq: powernow-k8: Use related_cpus instead of cpus in driver.exit() 2023-09-13 09:42:30 +02:00
powernow-k8.h
powernv-cpufreq.c cpufreq: Introducing CPUFREQ_RELATION_E 2021-10-05 16:33:05 +02:00
ppc_cbe_cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
ppc_cbe_cpufreq.h
ppc_cbe_cpufreq_pervasive.c
ppc_cbe_cpufreq_pmi.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
pxa2xx-cpufreq.c cpufreq: pxa3: move clk register access to clk driver 2022-05-07 22:55:49 +02:00
pxa3xx-cpufreq.c cpufreq: pxa3: move clk register access to clk driver 2022-05-07 22:55:49 +02:00
qcom-cpufreq-hw.c cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos 2023-05-11 23:03:12 +09:00
qcom-cpufreq-nvmem.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
qoriq-cpufreq.c drivers: cpufreq: Add missing of_node_put() in qoriq-cpufreq.c 2022-06-28 13:34:45 +05:30
raspberrypi-cpufreq.c
s3c24xx-cpufreq-debugfs.c
s3c24xx-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
s3c64xx-cpufreq.c
s3c2410-cpufreq.c
s3c2412-cpufreq.c
s3c2416-cpufreq.c
s3c2440-cpufreq.c cpufreq: s3c244x: add fallthrough comments for switch 2021-10-04 11:43:14 +05:30
s5pv210-cpufreq.c cpufreq: Introducing CPUFREQ_RELATION_E 2021-10-05 16:33:05 +02:00
sa1100-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
sa1110-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
sc520_freq.c cpufreq: sc520_freq: add 'fallthrough' to one case 2021-05-21 18:52:13 +02:00
scmi-cpufreq.c cpufreq: scmi: process the result of devm_of_clk_add_hw_provider() 2024-01-25 15:27:20 -08:00
scpi-cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
sh-cpufreq.c cpufreq: sh: Remove sh_cpufreq_cpu_ready() 2021-09-02 18:04:17 +02:00
sparc-us2e-cpufreq.c
sparc-us3-cpufreq.c
spear-cpufreq.c cpufreq: Remove CPUFREQ_STICKY flag 2021-02-04 19:23:20 +01:00
speedstep-centrino.c
speedstep-ich.c
speedstep-lib.c
speedstep-lib.h
speedstep-smi.c
sti-cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
sun50i-cpufreq-nvmem.c cpufreq: sun50i: Switch to use dev_err_probe() helper 2022-10-18 16:22:26 +05:30
tegra20-cpufreq.c cpufreq: Use of_property_present() for testing DT property presence 2024-01-25 15:27:20 -08:00
tegra124-cpufreq.c
tegra186-cpufreq.c cpufreq: tegra186/tegra194: Handle errors in BPMP response 2021-10-04 12:31:36 +05:30
tegra194-cpufreq.c cpufreq: tegra194: Fix module loading 2022-10-18 16:22:25 +05:30
ti-cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00
vexpress-spc-cpufreq.c cpufreq: Explicitly include correct DT includes 2024-03-26 18:20:31 -04:00