linux-stable/drivers/thermal
Rafael J. Wysocki df6071bd60 thermal: intel_powerclamp: Use first online CPU as control_cpu
commit 4bb7f6c278 upstream.

Commit 68b99e94a4 ("thermal: intel_powerclamp: Use get_cpu() instead
of smp_processor_id() to avoid crash") fixed an issue related to using
smp_processor_id() in preemptible context by replacing it with a pair
of get_cpu()/put_cpu(), but what is needed there really is any online
CPU and not necessarily the one currently running the code.  Arguably,
getting the one that's running the code in there is confusing.

For this reason, simply give the control CPU role to the first online
one which automatically will be CPU0 if it is online, so one check
can be dropped from the code for an added benefit.

Link: https://lore.kernel.org/linux-pm/20221011113646.GA12080@duo.ucw.cz/
Fixes: 68b99e94a4 ("thermal: intel_powerclamp: Use get_cpu() instead of smp_processor_id() to avoid crash")
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-10-26 12:22:55 +02:00
..
broadcom thermal/drivers/broadcom: Fix potential NULL dereference in sr_thermal_probe 2022-05-19 12:11:52 +02:00
intel thermal: intel_powerclamp: Use first online CPU as control_cpu 2022-10-26 12:22:55 +02:00
qcom thermal/drivers/qcom/tsens-v0_1: Fix MSM8939 fourth sensor hw_id 2022-10-21 12:39:01 +02:00
samsung thermal/drivers/exynos: Fix an error code in exynos_tmu_probe() 2021-08-14 12:40:35 +02:00
st thermal/drivers/st: Use devm_platform_get_and_ioremap_resource() 2021-06-14 19:01:15 +02:00
tegra thermal/core: Rename 'trips' to 'num_trips' 2022-07-28 17:29:56 +02:00
ti-soc-thermal thermal/ti-soc-thermal: Fix comment typo 2022-07-28 17:29:51 +02:00
Kconfig thermal: Drop obsolete dependency on COMPILE_TEST 2022-08-03 19:15:31 +02:00
Makefile thermal: k3_j72xx_bandgap: Add the bandgap driver support 2022-05-19 12:11:53 +02:00
amlogic_thermal.c
armada_thermal.c
cpufreq_cooling.c thermal: cpufreq_cooling: Check the policy first in cpufreq_cooling_register() 2022-10-21 12:37:59 +02:00
cpuidle_cooling.c
da9062-thermal.c
db8500_thermal.c thermal/drivers/u8500: Remove unnecessary print function dev_err() 2022-07-28 17:29:50 +02:00
devfreq_cooling.c Thermal control updates for 5.20-rc1 2022-08-02 11:27:53 -07:00
dove_thermal.c
gov_bang_bang.c
gov_fair_share.c thermal/core: Rename 'trips' to 'num_trips' 2022-07-28 17:29:56 +02:00
gov_power_allocator.c thermal/core: Rename 'trips' to 'num_trips' 2022-07-28 17:29:56 +02:00
gov_step_wise.c thermal/core: Remove DROP_FULL and RAISE_FULL 2022-07-28 17:29:47 +02:00
gov_user_space.c thermal/governor: Remove deprecated information 2022-04-22 16:47:40 +02:00
hisi_thermal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_320.RULE 2022-06-10 14:51:36 +02:00
imx8mm_thermal.c thermal/drivers/imx8mm: Enable ADC when enabling monitor 2021-12-02 11:12:24 +01:00
imx_sc_thermal.c thermal/drivers/imx_sc_thermal: Fix refcount leak in imx_sc_thermal_probe 2022-05-19 12:11:53 +02:00
imx_thermal.c thermal/drivers/imx: Implement runtime PM support 2021-11-30 15:42:28 +01:00
k3_bandgap.c thermal/drivers/k3: Add hwmon support 2022-05-19 12:11:51 +02:00
k3_j72xx_bandgap.c thermal/drivers/k3_j72xx_bandgap: Make k3_j72xx_bandgap_j721e_data and k3_j72xx_bandgap_j7200_data static 2022-07-28 17:29:48 +02:00
khadas_mcu_fan.c
kirkwood_thermal.c
max77620_thermal.c
mtk_thermal.c thermal/drivers/mediatek: Add sensors-support 2021-07-04 18:28:04 +02:00
qoriq_thermal.c
rcar_gen3_thermal.c Thermal control updates for 5.20-rc1 2022-08-02 11:27:53 -07:00
rcar_thermal.c thermal/drivers/rcar_thermal: Use platform_get_irq_optional() to get the interrupt 2022-05-19 12:11:50 +02:00
rockchip_thermal.c thermal/drivers/rockchip_thermal: Allow more resets for tsadc node 2021-10-17 00:15:09 +02:00
rzg2l_thermal.c thermal/drivers/rzg2l: Fix comments 2022-07-28 17:29:49 +02:00
spear_thermal.c
sprd_thermal.c thermal/drivers/sprd: Add missing of_node_put for loop iteration 2021-06-14 22:42:09 +02:00
sun8i_thermal.c thermal/drivers/sun8i: Fix typo in comment 2022-07-28 17:29:49 +02:00
thermal-generic-adc.c
thermal_core.c thermal/core: Add missing EXPORT_SYMBOL_GPL 2022-08-15 20:38:19 +02:00
thermal_core.h thermal/core: Move thermal_set_delay_jiffies to static 2022-07-28 17:29:55 +02:00
thermal_helpers.c thermal/core: Rename 'trips' to 'num_trips' 2022-07-28 17:29:56 +02:00
thermal_hwmon.c thermal/drivers/thermal_hwmon: Use hwmon_device_register_for_thermal() 2022-05-22 11:32:31 -07:00
thermal_hwmon.h
thermal_mmio.c thermal/drivers/thermal_mmio: Constify static struct thermal_mmio_ops 2021-10-07 15:18:31 +02:00
thermal_netlink.c thermal/core: Rename 'trips' to 'num_trips' 2022-07-28 17:29:56 +02:00
thermal_netlink.h thermal: netlink: Fix parameter type of thermal_genl_cpu_capability_event() stub 2022-02-07 20:45:42 +01:00
thermal_of.c thermal/of: Initialize trip points separately 2022-07-28 17:29:57 +02:00
thermal_sysfs.c thermal: sysfs: Fix cooling_device_stats_setup() error code path 2022-08-03 19:14:26 +02:00
uniphier_thermal.c thermal/drivers/uniphier: Add compatible string for NX1 SoC 2021-10-18 14:00:13 +02:00