1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/thermal
Yu-Che Cheng 0cde378a10 thermal: gov_power_allocator: Update total_weight on bind and cdev updates
params->total_weight is not initialized during bind and not updated when
the bound cdev changes. The cooling device weight will not be used due
to the uninitialized total_weight, until an update via sysfs is
triggered.

The bound cdevs are updated during thermal zone registration, where each
cooling device will be bound to the thermal zone one by one, but
power_allocator_bind() can be called without an additional cdev update
when manually changing the policy of a thermal zone via sysfs.

Add a new function to handle weight update logic, including updating
total_weight, and call it when bind, weight changes, and cdev updates to
ensure total_weight is always correct.

Fixes: a3cd6db4cc ("thermal: gov_power_allocator: Support new update callback of weights")
Signed-off-by: Yu-Che Cheng <giver@chromium.org>
Link: https://patch.msgid.link/20250222-fix-power-allocator-weight-v2-1-a94de86b685a@chromium.org
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2025-02-25 12:30:45 +01:00
..
broadcom thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
intel thermal: intel: Fix compile issue when CONFIG_NET is not defined 2024-12-19 12:35:46 +01:00
mediatek thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
qcom thermal: qcom-spmi-adc-tm5: Simplify with scoped for each OF child loop 2024-11-26 13:28:43 +01:00
renesas thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
samsung thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
st thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
tegra thermal: tegra: Simplify with scoped for each OF child loop 2024-11-26 13:28:43 +01:00
testing thermal: testing: Initialize some variables annoteded with _free() 2024-11-14 17:40:47 +01:00
ti-soc-thermal More thermal control updates for 6.13-rc1 2024-11-22 19:43:18 -08:00
amlogic_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
armada_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
cpufreq_cooling.c thermal/cpufreq_cooling: Remove structure member documentation 2025-02-11 21:02:13 +01:00
cpuidle_cooling.c thermal: cpuidle_cooling: fix kernel-doc warning and a spello 2023-12-21 12:05:48 +01:00
da9062-thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
db8500_thermal.c thermal/drivers/db8500: Remove redundant of_match_ptr() 2023-08-16 12:09:19 +02:00
devfreq_cooling.c thermal: devfreq_cooling: Fix perf state when calculate dfc res_util 2024-03-27 16:27:39 +01:00
dove_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
gov_bang_bang.c thermal: core: Rename function argument related to trip crossing 2025-01-17 18:48:58 +01:00
gov_fair_share.c thermal: core: Introduce thermal_cdev_update_nocheck() 2024-10-23 11:57:11 +02:00
gov_power_allocator.c thermal: gov_power_allocator: Update total_weight on bind and cdev updates 2025-02-25 12:30:45 +01:00
gov_step_wise.c thermal: core: Add and use cooling device guard 2024-10-24 14:48:23 +02:00
gov_user_space.c thermal: core: Rename function argument related to trip crossing 2025-01-17 18:48:58 +01:00
hisi_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
imx8mm_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
imx_sc_thermal.c thermal/drivers/imx_sc_thermal: Use dev_err_probe 2024-09-04 15:31:29 +02:00
imx_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
k3_bandgap.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
k3_j72xx_bandgap.c thermal/drivers/k3_j72xx_bandgap: Simplify code in k3_bgp_read_temp() 2024-11-13 18:37:00 +01:00
Kconfig thermal: Add PCIe cooling driver 2024-11-16 10:09:30 -06:00
khadas_mcu_fan.c thermal/core: Make cooling device state change private 2021-01-19 22:31:10 +01:00
kirkwood_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
loongson2_thermal.c thermal/drivers/loongson2: Add Loongson-2K2000 support 2024-04-23 12:40:30 +02:00
Makefile pci-v6.13-changes 2024-11-26 18:05:44 -08:00
max77620_thermal.c thermal/drivers/max77620: Remove duplicate error message 2023-10-15 23:40:10 +02:00
pcie_cooling.c thermal: Add PCIe cooling driver 2024-11-16 10:09:30 -06:00
qoriq_thermal.c thermal/drivers/qoriq: Remove __maybe_unused notations 2024-09-02 13:17:46 +02:00
rockchip_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
spear_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
sprd_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00
sun8i_thermal.c thermal: sun8i: Use scoped device node handling to simplify error paths 2024-11-26 13:28:43 +01:00
thermal-generic-adc.c thermal/drivers/generic-adc: Simplify with dev_err_probe() 2024-07-15 13:31:41 +02:00
thermal_core.c thermal: core: Rename function argument related to trip crossing 2025-01-17 18:48:58 +01:00
thermal_core.h thermal: core: Rename function argument related to trip crossing 2025-01-17 18:48:58 +01:00
thermal_debugfs.c thermal: core: Add and use cooling device guard 2024-10-24 14:48:23 +02:00
thermal_debugfs.h thermal/debugfs: Do not extend mitigation episodes beyond system resume 2024-06-11 21:04:00 +02:00
thermal_helpers.c thermal: core: Add and use cooling device guard 2024-10-24 14:48:23 +02:00
thermal_hwmon.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
thermal_hwmon.h thermal/hwmon: Use the right device for devm_thermal_add_hwmon_sysfs() 2023-03-03 20:45:02 +01:00
thermal_mmio.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
thermal_netlink.c thermal: netlink: Add the commands and the events for the thresholds 2024-10-24 14:54:01 +02:00
thermal_netlink.h thermal: netlink: Add the commands and the events for the thresholds 2024-10-24 14:54:01 +02:00
thermal_of.c thermal/of: Fix cdev lookup in thermal_of_should_bind() 2025-02-25 12:19:10 +01:00
thermal_sysfs.c thermal: core: Add and use cooling device guard 2024-10-24 14:48:23 +02:00
thermal_thresholds.c thermal/thresholds: Fix boundaries and detection routine 2024-12-18 14:51:31 +01:00
thermal_thresholds.h thermal: netlink: Add the commands and the events for the thresholds 2024-10-24 14:54:01 +02:00
thermal_trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
thermal_trace_ipa.h thermal: core: Make struct thermal_zone_device definition internal 2024-04-08 16:01:20 +02:00
thermal_trip.c thermal: core: Relocate functions that update trip points 2024-10-24 17:15:07 +02:00
uniphier_thermal.c thermal: Switch back to struct platform_driver::remove() 2024-11-13 16:17:57 +01:00