summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorLukasz Luba <lukasz.luba@arm.com>2023-12-20 23:17:52 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-12-29 18:01:01 +0100
commitbfc57bd1685981730bfe9802d9de7603a0a43bc4 (patch)
treee5043e60f15a1b4407813d0f7dddacfc496edd5d /drivers/thermal
parent879c9dc511732b74a04f11336e00f12783337a8a (diff)
thermal/sysfs: Update governors when the 'weight' has changed
Support governors update when the thermal instance's weight has changed. This allows to adjust internal state for the governor. Signed-off-by: Lukasz Luba <lukasz.luba@arm.com> [ rjw: Add two empty code lines aroung the locking ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_sysfs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index 299c0fb16593..f4033865b093 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -939,7 +939,12 @@ ssize_t weight_store(struct device *dev, struct device_attribute *attr,
/* Don't race with governors using the 'weight' value */
mutex_lock(&instance->tz->lock);
+
instance->weight = weight;
+
+ thermal_governor_update_tz(instance->tz,
+ THERMAL_INSTANCE_WEIGHT_CHANGED);
+
mutex_unlock(&instance->tz->lock);
return count;