+ hwmon-enhance-the-sysfs-api-for-power-meters.patch added to -mm tree
Subsystems (3)
[email protected]
tree noticeThe patch titled
hwmon: enhance the sysfs API for power meters
has been added to the -mm tree. Its filename is
hwmon-enhance-the-sysfs-api-for-power-meters.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: hwmon: enhance the sysfs API for power meters
From: "Darrick J. Wong" <[email protected]>
Augment the documentation of the hwmon sysfs API to accomodate ACPI power meters.
---
Documentation/hwmon/sysfs-interface | 60 +++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-)
Documentation/hwmon/sysfs-interface renamed from Documentation/hwmon/sysfs-interface~hwmon-enhance-the-sysfs-api-for-power-meters +59 -1
@@ -353,10 +353,20 @@ power[1-*]_average Average power use Unit: microWatt RO -power[1-*]_average_interval Power use averaging interval +power[1-*]_average_interval Power use averaging interval. A poll + notification is sent to this file if the + hardware changes the averaging interval. Unit: milliseconds RW +power[1-*]_average_interval_max Maximum power use averaging interval + Unit: milliseconds + RO + +power[1-*]_average_interval_min Minimum power use averaging interval + Unit: milliseconds + RO + power[1-*]_average_highest Historical average maximum power use Unit: microWatt RO
@@ -365,6 +375,18 @@ power[1-*]_average_lowest Historical ave Unit: microWatt RO +power[1-*]_average_max A poll notification is sent to + power[1-*]_average when power use + rises above this value. + Unit: microWatt + RW + +power[1-*]_average_min A poll notification is sent to + power[1-*]_average when power use + sinks below this value. + Unit: microWatt + RW + power[1-*]_input Instantaneous power use Unit: microWatt RO
@@ -381,6 +403,42 @@ power[1-*]_reset_history Reset input_hig average_highest and average_lowest. WO +power[1-*]_accuracy Accuracy of the power meter. + Unit: Percent + RO + +power[1-*]_alarm 1 if the system is drawing more power than the + cap allows; 0 otherwise. A poll notification is + sent to this file if the power use exceeds the + cap. The action that is taken when this event + happens is undefined--it is possible that the + hardware will reduce performance to cut the + power use, but it is also possible that the + system designer expects the OS to try to + reduce power consumption. Contact your + machine's vendor to find out which. + RO + +power[1-*]_cap If power use rises above this limit, the + system should take action to reduce power use. + A poll notification is sent to this file if the + cap is changed by the hardware. + Unit: microWatt + RW + +power[1-*]_cap_hyst Margin of hysteresis built around capping and + notification. + Unit: microWatt + RW + +power[1-*]_cap_max Maximum cap that can be set. + Unit: microWatt + RO + +power[1-*]_cap_min Minimum cap that can be set. + Unit: microWatt + RO + ********** * Energy * **********
_
Patches currently in -mm which might be from [email protected] are
hwmon-enhance-the-sysfs-api-for-power-meters.patch acpi_power_meter-hwmon-driver-for-acpi-40-power-meters.patch
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 1/1 hwmon driver for ACPI 4.0 power meters
This driver exposes ACPI 4.0 compliant power meters as hardware monitoring devices. This second revision of the driver also exports the ACPI string info as sysfs attributes, a list of the devices that the meter measures, and will send ACPI notifications over the ACPI netlink socket. This latest revision only enables the power capping controls if it can be confirmed that the power cap can be enforced by the hardware.
---
Documentation/hwmon/acpi_power_meter | 31 + drivers/acpi/Kconfig | 12 drivers/acpi/Makefile | 1 drivers/acpi/power_meter.c | 1017 ++++++++++++++++++++++++++++++++++ 4 files changed, 1061 insertions(+), 0 deletions(-) create mode 100644 Documentation/hwmon/acpi_power_meter create mode 100644 drivers/acpi/power_meter.c
Documentation/hwmon/acpi_power_meter new file +30 -0
@@ -0,0 +1,31 @@ +Kernel driver power_meter +============+ +This driver talks to ACPI 4.0 power meters. + +Supported systems: + * Any recent system with ACPI 4.0. + Prefix: 'power_meter' + Datasheet: http://acpi.info/, section 10.4. + +Author: Darrick J. Wong + +Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points. + +Special Features +---------------- + +The power[1-*]_is_battery knob indicates if the power supply is a battery. +Both power[1-*]_average_{min,max} must be set before the trip points will work. +The power[1-*]_{model_number, serial_number, oem_info} fields display arbitrary +strings that ACPI provides with the meter. +The measures/ directory contains symlinks to the devices that this meter +measures. +ACPI events will be broadcast on the ACPI netlink event socket in addition to +the poll notifications.
drivers/acpi/Kconfig +12 -0
@@ -82,6 +82,18 @@ config ACPI_PROCFS_POWER Say N to delete power /proc/acpi/ directories that have moved to /sys/ +config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default m + help + This driver exposes ACPI 4.0 power meters as hardware monitoring + devices. Say Y (or M) if you have an Intel or AMD computer with + a power meter. + + To compile this driver as a module, choose M here: + the module will be called power-meter. + config ACPI_SYSFS_POWER bool "Future power /sys interface" select POWER_SUPPLY
drivers/acpi/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbs.o +obj-$(CONFIG_ACPI_POWER_METER) += power_meter.o # processor has its own "processor." module_param namespace processor-y := processor_core.o processor_throttling.o
drivers/acpi/power_meter.c new file +1015 -0
1,015 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v3] hwmon driver for ACPI 4.0 power meters
Hi!
Quoted 14 lines
Documentation/hwmon/acpi_power_meter new file +8
-0@@ -0,0 +1,31 @@ +Kernel driver power_meter +============> + +This driver talks to ACPI 4.0 power meters. + +Supported systems: + * Any recent system with ACPI 4.0. + Prefix: 'power_meter' + Datasheet: http://acpi.info/, section 10.4.
Documentation/hwmon/acpi_power_meter line 18
Quoted 10 lines
Documentation/hwmon/acpi_power_meter new file +10
-0+ +Author: Darrick J. Wong + +Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points.
So where do we get the average power?
Quoted 6 lines
Documentation/hwmon/acpi_power_meter new file +5
-0+Special Features +---------------- + +The power[1-*]_is_battery knob indicates if the power supply is a battery. +Both power[1-*]_average_{min,max} must be set before the trippoints will work.
How do trip points work? It is not explained here.
Documentation/hwmon/acpi_power_meter
Quoted 4 lines
Documentation/hwmon/acpi_power_meter new file +4
-0+config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default m
default M is "evil".
Documentation/hwmon/acpi_power_meter
Quoted 2 lines
Documentation/hwmon/acpi_power_meter new file +2
-0+ devices. Say Y (or M) if you have an Intel or AMD computer with + a power meter.
WTF? Neither Intel nor AMD makes _computers_.
Documentation/hwmon/acpi_power_meter
Quoted 2 lines
Documentation/hwmon/acpi_power_meter new file +2
-0+ To compile this driver as a module, choose M here: + the module will be called power-meter.
.ko.
Quoted 1 line
+#define
POWER_CAP_NAME"power1_cap"
I did not see power cap explained.
Pavel
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v3] hwmon driver for ACPI 4.0 power meters
Quoted 9 lines · Pavel Machek
Documentation/hwmon/acpi_power_meter line 18
Quoted 7 lines
Documentation/hwmon/acpi_power_meter new file +7
-0+Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points.So where do we get the average power?
/sys/class/hwmon/hwmonX/device/powerX_average. Most of the hwmon driver documentation assumes the reader has read the contents of Documentation/hwmon/sysfs-interface, but I suppose it wouldn't be too difficult to call that out explicitly.
(Actually I think you're really supposed to use libsensors and not access sysfs directly.)
Quoted 8 lines
Quoted 6 lines
Documentation/hwmon/acpi_power_meter new file +5
-0+Special Features +---------------- + +The power[1-*]_is_battery knob indicates if the power supply is a battery. +Both power[1-*]_average_{min,max} must be set before the trippoints will work.
How do trip points work? It is not explained here.
Will add that too.
Quoted 6 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 88
Quoted 4 lines
drivers/acpi/Kconfig +4
-0+config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default mdefault M is "evil".
I'll change it to Y, but I wonder why you think default M is evil...?
Quoted 4 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 92
Quoted 2 lines
drivers/acpi/Kconfig +2
-0+ devices. Say Y (or M) if you have an Intel or AMD computer with + a power meter.WTF? Neither Intel nor AMD makes _computers_.
I'll change that to "a computer with ACPI firmware."
Quoted 4 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 95
Quoted 2 lines
drivers/acpi/Kconfig +2
-0+ To compile this driver as a module, choose M here: + the module will be called power-meter..ko.
The other config options in drivers/acpi/Kconfig omit the .ko; I was trying to be consistent with them.
Quoted 3 lines
Quoted 1 line
+#define
POWER_CAP_NAME"power1_cap"I did not see power cap explained.
I'll add that, thanks for the continued review!
--D
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v3] hwmon driver for ACPI 4.0 power meters
Quoted 12 lines · Darrick J. Wong
Quoted 9 lines · Pavel Machek
Documentation/hwmon/acpi_power_meter line 18
Quoted 7 lines
Documentation/hwmon/acpi_power_meter new file +7
-0+Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points.So where do we get the average power?
Quoted 4 lines
/sys/class/hwmon/hwmonX/device/powerX_average. Most of the hwmon driver documentation assumes the reader has read the contents ofDocumentation/hwmon/sysfs-interface, but I suppose it wouldn't be too difficult to call that out explicitly.
Ok, I did not realize that hwmon/sysfs-interface applies here. Maybe mention that? Copyring info is probably not good.
Quoted 8 lines
Quoted 6 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 88
Quoted 4 lines
drivers/acpi/Kconfig +4
-0+config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default mdefault M is "evil".
I'll change it to Y, but I wonder why you think default M is evil...?
See the archives. Anyway it should be default to N -- it is new driver and it is not essential in any way. "default Y" is for features that were always in and are now optional.
Quoted 6 lines
Quoted 4 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 92
Quoted 2 lines
drivers/acpi/Kconfig +2
-0+ devices. Say Y (or M) if you have an Intel or AMD computer with + a power meter.WTF? Neither Intel nor AMD makes _computers_.
I'll change that to "a computer with ACPI firmware."
I'd add that it only makes sense on very new computers.
Quoted 7 lines
Quoted 4 lines
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 95
Quoted 2 lines
drivers/acpi/Kconfig +2
-0+ To compile this driver as a module, choose M here: + the module will be called power-meter..ko.
The other config options in
drivers/acpi/Kconfigomit the .ko; I was trying to be consistent with them.
Probably my fault, sorry.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
+#define
POWER_CAP_NAME"power1_cap"I did not see power cap explained.
I'll add that, thanks for the continued review!
You are welcome.
Pavel
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v3] hwmon driver for ACPI 4.0 power meters
Quoted 3 lines · Pavel Machek
See the archives. Anyway it should be default to N -- it is new driver and it is not essential in any way. "default Y" is for features that were always in and are now optional.
I suppose you have a point--it's not terribly essential. I've just sent v5 with default N.
--D
PATCH v4 1/1 hwmon driver for ACPI 4.0 power meters
In reply to Darrick J. WongThis driver exposes ACPI 4.0 compliant power meters as hardware monitoring devices. This second revision of the driver also exports the ACPI string info as sysfs attributes, a list of the devices that the meter measures, and will send ACPI notifications over the ACPI netlink socket. This latest revision only enables the power capping controls if it can be confirmed that the power cap can be enforced by the hardware and explains how the notification interfaces work.
---
Documentation/hwmon/acpi_power_meter | 51 ++ drivers/acpi/Kconfig | 12 drivers/acpi/Makefile | 1 drivers/acpi/power_meter.c | 1017 ++++++++++++++++++++++++++++++++++ 4 files changed, 1081 insertions(+), 0 deletions(-) create mode 100644 Documentation/hwmon/acpi_power_meter create mode 100644 drivers/acpi/power_meter.c
Documentation/hwmon/acpi_power_meter new file +50 -0
@@ -0,0 +1,51 @@ +Kernel driver power_meter +============+ +This driver talks to ACPI 4.0 power meters. + +Supported systems: + * Any recent system with ACPI 4.0. + Prefix: 'power_meter' + Datasheet: http://acpi.info/, section 10.4. + +Author: Darrick J. Wong + +Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points. The +sysfs interface conforms with the specification outlined in the "Power" section +of Documentation/hwmon/sysfs-interface. + +Special Features +---------------- + +The power[1-*]_is_battery knob indicates if the power supply is a battery. +Both power[1-*]_average_{min,max} must be set before the trip points will work. +When both of them are set, an ACPI event will be broadcast on the ACPI netlink +socket and a poll notification will be sent to the appropriate +power[1-*]_average sysfs file. + +The power[1-*]_{model_number, serial_number, oem_info} fields display arbitrary +strings that ACPI provides with the meter. The measures/ directory contains +symlinks to the devices that this meter measures. + +Some computers have the ability to enforce a power cap in hardware. If this is +the case, the power[1-*]_cap and related sysfs files will appear. When the +average power consumption exceeds the cap, an ACPI event will be broadcast on +the netlink event socket and a poll notification will be sent to the +appropriate power[1-*]_alarm file to indicate that capping has begun, and the +hardware has taken action to reduce power consumption. Most likely this will +result in reduced performance. + +There are a few other ACPI notifications that can be sent by the firmware. In +all cases the ACPI event will be broadcast on the ACPI netlink event socket as +well as sent as a poll notification to a sysfs file. The events are as +follows: + +power[1-*]_cap will be notified if the firmware changes the power cap. +power[1-*]_interval will be notified if the firmware changes the averaging +interval.
drivers/acpi/Kconfig +12 -0
@@ -82,6 +82,18 @@ config ACPI_PROCFS_POWER Say N to delete power /proc/acpi/ directories that have moved to /sys/ +config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default y + help + This driver exposes ACPI 4.0 power meters as hardware monitoring + devices. Say Y (or M) if you have a computer with ACPI 4.0 firmware + and a power meter. + + To compile this driver as a module, choose M here: + the module will be called power-meter. + config ACPI_SYSFS_POWER bool "Future power /sys interface" select POWER_SUPPLY
drivers/acpi/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbs.o +obj-$(CONFIG_ACPI_POWER_METER) += power_meter.o # processor has its own "processor." module_param namespace processor-y := processor_core.o processor_throttling.o
drivers/acpi/power_meter.c new file +1015 -0
1,015 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Re: [PATCH v4] hwmon driver for ACPI 4.0 power meters
drivers/acpi/Kconfig config ACPI_PROCFS_POWER · line 88
Quoted 4 lines
drivers/acpi/Kconfig +4
-0+config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default y
Should not really be default y, see the other mail.
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
PATCH v5 1/1 hwmon driver for ACPI 4.0 power meters
In reply to Darrick J. WongThis driver exposes ACPI 4.0 compliant power meters as hardware monitoring devices. This second revision of the driver also exports the ACPI string info as sysfs attributes, a list of the devices that the meter measures, and will send ACPI notifications over the ACPI netlink socket. This latest revision only enables the power capping controls if it can be confirmed that the power cap can be enforced by the hardware and explains how the notification interfaces work.
---
Documentation/hwmon/acpi_power_meter | 51 ++ drivers/acpi/Kconfig | 12 drivers/acpi/Makefile | 1 drivers/acpi/power_meter.c | 1017 ++++++++++++++++++++++++++++++++++ 4 files changed, 1081 insertions(+), 0 deletions(-) create mode 100644 Documentation/hwmon/acpi_power_meter create mode 100644 drivers/acpi/power_meter.c
Documentation/hwmon/acpi_power_meter new file +50 -0
@@ -0,0 +1,51 @@ +Kernel driver power_meter +============+ +This driver talks to ACPI 4.0 power meters. + +Supported systems: + * Any recent system with ACPI 4.0. + Prefix: 'power_meter' + Datasheet: http://acpi.info/, section 10.4. + +Author: Darrick J. Wong + +Description +----------- + +This driver implements sensor reading support for the power meters exposed in +the ACPI 4.0 spec (Chapter 10.4). These devices have a simple set of +features--a power meter that returns average power use over a configurable +interval, an optional capping mechanism, and a couple of trip points. The +sysfs interface conforms with the specification outlined in the "Power" section +of Documentation/hwmon/sysfs-interface. + +Special Features +---------------- + +The power[1-*]_is_battery knob indicates if the power supply is a battery. +Both power[1-*]_average_{min,max} must be set before the trip points will work. +When both of them are set, an ACPI event will be broadcast on the ACPI netlink +socket and a poll notification will be sent to the appropriate +power[1-*]_average sysfs file. + +The power[1-*]_{model_number, serial_number, oem_info} fields display arbitrary +strings that ACPI provides with the meter. The measures/ directory contains +symlinks to the devices that this meter measures. + +Some computers have the ability to enforce a power cap in hardware. If this is +the case, the power[1-*]_cap and related sysfs files will appear. When the +average power consumption exceeds the cap, an ACPI event will be broadcast on +the netlink event socket and a poll notification will be sent to the +appropriate power[1-*]_alarm file to indicate that capping has begun, and the +hardware has taken action to reduce power consumption. Most likely this will +result in reduced performance. + +There are a few other ACPI notifications that can be sent by the firmware. In +all cases the ACPI event will be broadcast on the ACPI netlink event socket as +well as sent as a poll notification to a sysfs file. The events are as +follows: + +power[1-*]_cap will be notified if the firmware changes the power cap. +power[1-*]_interval will be notified if the firmware changes the averaging +interval.
drivers/acpi/Kconfig +12 -0
@@ -82,6 +82,18 @@ config ACPI_PROCFS_POWER Say N to delete power /proc/acpi/ directories that have moved to /sys/ +config ACPI_POWER_METER + tristate "ACPI 4.0 power meter" + depends on HWMON + default n + help + This driver exposes ACPI 4.0 power meters as hardware monitoring + devices. Say Y (or M) if you have a computer with ACPI 4.0 firmware + and a power meter. + + To compile this driver as a module, choose M here: + the module will be called power-meter. + config ACPI_SYSFS_POWER bool "Future power /sys interface" select POWER_SUPPLY
drivers/acpi/Makefile +1 -0
@@ -56,6 +56,7 @@ obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_BATTERY) += battery.o obj-$(CONFIG_ACPI_SBS) += sbshc.o obj-$(CONFIG_ACPI_SBS) += sbs.o +obj-$(CONFIG_ACPI_POWER_METER) += power_meter.o # processor has its own "processor." module_param namespace processor-y := processor_core.o processor_throttling.o
drivers/acpi/power_meter.c new file +1015 -0
1,015 lines not on this page · raw message
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors