Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1341359

[RFC][PATCH] thermal: add sysfs_notify on some attributes

From Srikar Srimath Tirumala <srikars@nvidia.com>
Newsgroups linux.kernel
Subject [RFC][PATCH] thermal: add sysfs_notify on some attributes
Date 2016-02-24 05:20 +0100
Message-ID <r5z5G-7tx-57@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Add a sysfs_notify on thermal_zone*/temp and cooling_device*/
cur_state whenever a passive or critical trip is triggered.

This change allows usermode apps to register itself to get notified,
when certain thermal conditions occur and reduce their workload.
This workload throttling can reduce\prevent throttling of hardware
clocks while allowing some other critical apps to run longer reliably.

Signed-off-by: Srikar Srimath Tirumala <srikars@nvidia.com>
---
 drivers/thermal/thermal_core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index a0a8fd1..d8d257d 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -567,6 +567,8 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
 
 	for (count = 0; count < tz->trips; count++)
 		handle_thermal_trip(tz, count);
+
+	sysfs_notify(&tz->device.kobj, NULL, "temp");
 }
 EXPORT_SYMBOL_GPL(thermal_zone_device_update);
 
@@ -1638,6 +1640,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
 	cdev->updated = true;
 	trace_cdev_update(cdev, target);
 	dev_dbg(&cdev->device, "set to state %lu\n", target);
+	sysfs_notify(&cdev->device.kobj, NULL, "cur_state");
 }
 EXPORT_SYMBOL(thermal_cdev_update);
 
-- 
2.1.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[RFC][PATCH] thermal: add sysfs_notify on some attributes Srikar Srimath Tirumala <srikars@nvidia.com> - 2016-02-24 05:20 +0100
  Re: [RFC][PATCH] thermal: add sysfs_notify on some attributes "Pandruvada, Srinivas" <srinivas.pandruvada@intel.com> - 2016-02-24 21:30 +0100
    Re: [RFC][PATCH] thermal: add sysfs_notify on some attributes Srikar Srimath Tirumala <srikars@nvidia.com> - 2016-02-26 01:30 +0100

csiph-web