lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 23 Feb 2016 20:11:58 -0800
From:	Srikar Srimath Tirumala <srikars@...dia.com>
To:	srikars@...dia.com, linux-pm@...r.kernel.org,
	linux-tegra@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [RFC][PATCH] thermal: add sysfs_notify on some attributes

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@...dia.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ