From: Srikar Srimath Tirumala <srikars@nvidia.com>
To: srikars@nvidia.com, linux-pm@vger.kernel.org,
linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [RFC][PATCH] thermal: add sysfs_notify on some attributes
Date: Tue, 23 Feb 2016 20:11:58 -0800 [thread overview]
Message-ID: <1456287118-32510-1-git-send-email-srikars@nvidia.com> (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
next reply other threads:[~2016-02-24 4:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-24 4:11 Srikar Srimath Tirumala [this message]
2016-02-24 20:24 ` [RFC][PATCH] thermal: add sysfs_notify on some attributes Pandruvada, Srinivas
[not found] ` <1456345360.3860.9.camel-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-02-26 0:24 ` Srikar Srimath Tirumala
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456287118-32510-1-git-send-email-srikars@nvidia.com \
--to=srikars@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).