On Tue, 2016-02-23 at 20:11 -0800, Srikar Srimath Tirumala wrote:Agreed, when the first trip point is violated it would result in two
Add a sysfs_notify on thermal_zone*/temp and cooling_device*/When user space governor is used this will result in two notifications
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
Signed-off-by: Srikar Srimath Tirumala <srikars@xxxxxxxxxx>
drivers/thermal/thermal_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/thermal/thermal_core.c
index a0a8fd1..d8d257d 100644
@@ -567,6 +567,8 @@ void thermal_zone_device_update(struct
for (count = 0; count < tz->trips; count++)
+ sysfs_notify(&tz->device.kobj, NULL, "temp");
to user space.
Also you want when a trip is violated. For some driver there will beAgreed, Patch V2 will do the notify only once per thermal zone and only
too many calls from irq thread, so you may want in handle_thermal_trip
when a trip is violated.
Thanks for your inputs Srinivas, please take a look at Patch V2 that
@@ -1638,6 +1640,7 @@ void thermal_cdev_update(struct
cdev->updated = true;
dev_dbg(&cdev->device, "set to state %lu\n", target);
+ sysfs_notify(&cdev->device.kobj, NULL, "cur_state");