Skip to contentSkip to conversation

[ASUS EC Sensors V6 v6 0/3]

PATCH Superseded Eugene Shalygin 3 participants 9 messages Jan 16, 2022 – Jan 18, 2022

Subsystems (3)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore

Eugene Shalygin

author maintainer
#0 lore raw

v6 cover [ASUS EC Sensors V6 v6 0/3]

This patchset replaces the HWMON asus_wmi_ec_sensors driver with an implementation that does not use WMI but queries the embedded controller directly.

That provides two enhancements: sensor reading became quicker (on some systems or kernel configuration it took almost a full second to read all the sensors, that transfers less than 15 bytes of data), the driver became more fexible. The driver now relies on ACPI mutex to lock access to the EC, in the same way as the WMI DSDT code does.

Changes in v6:
- Fixed hwmon device name replacing dashes with underscores.
- Removed module verion.
- Fixed condition for asus_wmi_ec_Sensors in KBuild.

Changes in v5:
- Place the sensors bitset directly into the driver_data field of the dmi_system_id struct.
- Replace doc comments with regular ones.

Changes in v4:
- Deprecate the wmi driver rather than removing it.

Changes in v3:
- Remove BIOS version checks and BIOS version dependent mutex path.

Changes in v2:
- Replace sensor flags enum with bitset
- Replace module init/probe functions with module_platform_driver_probe and ask the platform drivers framework to load the driver when ACPI EC is found (ACPI ID "PNP0C09").
- Extend board data with BIOS version attribute for the mutex path to be BIOS version dependent.
- Add module parameter to override the mutex path.

Eugene Shalygin (3):
hwmon: (asus-ec-sensors) add driver for ASUS EC
hwmon: (asus-ec-sensors) update documentation
hwmon: deprecate asis_wmi_ec_sensors driver

 Documentation/hwmon/asus_ec_sensors.rst     |  51 ++
 Documentation/hwmon/asus_wmi_ec_sensors.rst |  38 --
 MAINTAINERS                                 |   6 +
 drivers/hwmon/Kconfig                       |  16 +-
 drivers/hwmon/Makefile                      |   1 +
 drivers/hwmon/asus-ec-sensors.c             | 690 ++++++++++++++++++++
 6 files changed, 763 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/hwmon/asus_ec_sensors.rst
 delete mode 100644 Documentation/hwmon/asus_wmi_ec_sensors.rst
 create mode 100644 drivers/hwmon/asus-ec-sensors.c
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v6 1/3 hwmon: (asus-ec-sensors) add driver for ASUS EC

This driver provides the same data as the asus_wmi_ec_sensors driver (and gets it from the same source) but does not use WMI, polling the ACPI EC directly.

That provides two enhancements: sensor reading became quicker (on some systems or kernel configuration it took almost a full second to read all the sensors, that transfers less than 15 bytes of data), the driver became more flexible. The driver now relies on ACPI mutex to lock access to the EC in the same way as the WMI code does.

---
 MAINTAINERS                     |   6 +
 drivers/hwmon/Kconfig           |  11 +
 drivers/hwmon/Makefile          |   1 +
 drivers/hwmon/asus-ec-sensors.c | 690 ++++++++++++++++++++++++++++++++
 4 files changed, 708 insertions(+)
 create mode 100644 drivers/hwmon/asus-ec-sensors.c
MAINTAINERS +6 -0
index fddd28d3db15..845f09bc0457 100644
@@ -3012,6 +3012,12 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/hwmon/asus_wmi_ec_sensors.c
 
+ASUS EC HARDWARE MONITOR DRIVER
+M:	Eugene Shalygin <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/hwmon/asus-ec-sensors.c
+
 ASUS WIRELESS RADIO CONTROL DRIVER
 M:	João Paulo Rechi Vita <[email protected]>
 L:	[email protected]
drivers/hwmon/Kconfig +11 -0
index 43e5245874ad..2c16b19d2c03 100644
@@ -2253,6 +2253,17 @@ config SENSORS_ASUS_WMI_EC
 	  This driver can also be built as a module. If so, the module
 	  will be called asus_wmi_sensors_ec.
 
+config SENSORS_ASUS_EC
+	tristate "ASUS EC Sensors"
+	help
+	  If you say yes here you get support for the ACPI embedded controller
+	  hardware monitoring interface found in ASUS motherboards. The driver
+	  currently supports B550/X570 boards, although other ASUS boards might
+	  provide this monitoring interface as well.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called asus_ec_sensors.
+
 endif # ACPI
 
 endif # HWMON
drivers/hwmon/Makefile +1 -0
index 3a1551b3d570..2e5c216bb5d7 100644
@@ -9,6 +9,7 @@ obj-$(CONFIG_HWMON_VID)		+= hwmon-vid.o
 # APCI drivers
 obj-$(CONFIG_SENSORS_ACPI_POWER) += acpi_power_meter.o
 obj-$(CONFIG_SENSORS_ATK0110)	+= asus_atk0110.o
+obj-$(CONFIG_SENSORS_ASUS_EC)	+= asus-ec-sensors.o
 obj-$(CONFIG_SENSORS_ASUS_WMI)	+= asus_wmi_sensors.o
 obj-$(CONFIG_SENSORS_ASUS_WMI_EC)	+= asus_wmi_ec_sensors.o
 
drivers/hwmon/asus-ec-sensors.c new file +690 -0

690 lines not on this page · raw message

Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH v6 2/3 hwmon: (asus-ec-sensors) update documentation

In reply to Eugene Shalygin
---
 Documentation/hwmon/asus_ec_sensors.rst     | 51 +++++++++++++++++++++
 Documentation/hwmon/asus_wmi_ec_sensors.rst | 38 ---------------
 2 files changed, 51 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/hwmon/asus_ec_sensors.rst
 delete mode 100644 Documentation/hwmon/asus_wmi_ec_sensors.rst
Documentation/hwmon/asus_ec_sensors.rst new file +51 -0
new file mode 100644
index 000000000000..b8820cd1bd62
@@ -0,0 +1,51 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+Kernel driver asus_ec_sensors
+=================================
+
+Supported boards:
+ * PRIME X570-PRO,
+ * Pro WS X570-ACE,
+ * ROG CROSSHAIR VIII DARK HERO,
+ * ROG CROSSHAIR VIII FORMULA,
+ * ROG CROSSHAIR VIII HERO,
+ * ROG CROSSHAIR VIII IMPACT,
+ * ROG STRIX B550-E GAMING,
+ * ROG STRIX B550-I GAMING,
+ * ROG STRIX X570-E GAMING,
+ * ROG STRIX X570-I GAMING
+
+Authors:
+    - Eugene Shalygin <[email protected]>
+
+Description:
+------------
+ASUS mainboards publish hardware monitoring information via Super I/O
+chip and the ACPI embedded controller (EC) registers. Some of the sensors
+are only available via the EC.
+
+The driver is aware of and reads the following sensors:
+
+1. Chipset (PCH) temperature
+2. CPU package temperature
+3. Motherboard temperature
+4. Readings from the T_Sensor header
+5. VRM temperature
+6. CPU_Opt fan RPM
+7. VRM heatsink fan RPM
+8. Chipset fan RPM
+9. Readings from the "Water flow meter" header (RPM)
+10. Readings from the "Water In" and "Water Out" temperature headers
+11. CPU current
+
+Sensor values are read from EC registers, and to avoid race with the board
+firmware the driver acquires ACPI mutex, the one used by the WMI when its
+methods access the EC.
+
+Module Parameters
+-----------------
+ * mutex_path: string
+		The driver holds path to the ACPI mutex for each board (actually,
+		the path is mostly identical for them). If ASUS changes this path
+		in a future BIOS update, this parameter can be used to override
+		the stored in the driver value until it gets updated.
Documentation/hwmon/asus_wmi_ec_sensors.rst deleted +0 -38
deleted file mode 100644
index 1b287f229e86..000000000000
@@ -1,38 +0,0 @@
-.. SPDX-License-Identifier: GPL-2.0-or-later
-
-Kernel driver asus_wmi_ec_sensors
-=================================
-
-Supported boards:
- * PRIME X570-PRO,
- * Pro WS X570-ACE,
- * ROG CROSSHAIR VIII DARK HERO,
- * ROG CROSSHAIR VIII FORMULA,
- * ROG CROSSHAIR VIII HERO,
- * ROG STRIX B550-E GAMING,
- * ROG STRIX B550-I GAMING,
- * ROG STRIX X570-E GAMING.
-
-Authors:
-    - Eugene Shalygin <[email protected]>
-
-Description:
-------------
-ASUS mainboards publish hardware monitoring information via Super I/O
-chip and the ACPI embedded controller (EC) registers. Some of the sensors
-are only available via the EC.
-
-ASUS WMI interface provides a method (BREC) to read data from EC registers,
-which is utilized by this driver to publish those sensor readings to the
-HWMON system. The driver is aware of and reads the following sensors:
-
-1. Chipset (PCH) temperature
-2. CPU package temperature
-3. Motherboard temperature
-4. Readings from the T_Sensor header
-5. VRM temperature
-6. CPU_Opt fan RPM
-7. Chipset fan RPM
-8. Readings from the "Water flow meter" header (RPM)
-9. Readings from the "Water In" and "Water Out" temperature headers
-10. CPU current
Signature · 1 line
2.34.1
author maintainer
#3 lore raw

PATCH v6 3/3 hwmon: deprecate asis_wmi_ec_sensors driver

In reply to Eugene Shalygin
---
 drivers/hwmon/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hwmon/Kconfig +4 -1
index 2c16b19d2c03..38094c702e4d 100644
@@ -2243,13 +2243,16 @@ config SENSORS_ASUS_WMI
 
 config SENSORS_ASUS_WMI_EC
 	tristate "ASUS WMI B550/X570"
-	depends on ACPI_WMI
+	depends on ACPI_WMI && SENSORS_ASUS_EC=n
 	help
 	  If you say yes here you get support for the ACPI embedded controller
 	  hardware monitoring interface found in B550/X570 ASUS motherboards.
 	  This driver will provide readings of fans, voltages and temperatures
 	  through the system firmware.
 
+	  This driver is deprecated in favor of the ASUS EC Sensors driver
+	  which provides fully compatible output.
+
 	  This driver can also be built as a module. If so, the module
 	  will be called asus_wmi_sensors_ec.
 
Signature · 1 line
2.34.1
maintainer
#4 lore raw

Re: [ASUS EC Sensors V6 v6 3/3] hwmon: deprecate asis_wmi_ec_sensors driver

No description, no Signed-off-by:. Sorry, you'll have to resend.

Guenter

Quoted 27 lines · Eugene Shalygin
---
  drivers/hwmon/Kconfig | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)
drivers/hwmon/Kconfig +4 -1
index 2c16b19d2c03..38094c702e4d 100644
@@ -2243,13 +2243,16 @@ config SENSORS_ASUS_WMI
 
  config SENSORS_ASUS_WMI_EC
  	tristate "ASUS WMI B550/X570"
-	depends on ACPI_WMI
+	depends on ACPI_WMI && SENSORS_ASUS_EC=n
  	help
  	  If you say yes here you get support for the ACPI embedded controller
  	  hardware monitoring interface found in B550/X570 ASUS motherboards.
  	  This driver will provide readings of fans, voltages and temperatures
  	  through the system firmware.
 
+	  This driver is deprecated in favor of the ASUS EC Sensors driver
+	  which provides fully compatible output.
+
  	  This driver can also be built as a module. If so, the module
  	  will be called asus_wmi_sensors_ec.
 
Tested-by on the v6 series
#5 lore raw
In reply to Eugene Shalygin

Hello.

Quoted 10 lines · On neděle 16. ledna 2022 21:18:38 CET Eugene Shalygin wrote:

This patchset replaces the HWMON asus_wmi_ec_sensors driver with an implementation that does not use WMI but queries the embedded controller directly.

That provides two enhancements: sensor reading became quicker (on some systems or kernel configuration it took almost a full second to read all the sensors, that transfers less than 15 bytes of data), the driver became more fexible. The driver now relies on ACPI mutex to lock access to the EC, in the same way as the WMI DSDT code does.

Quoted 4 lines

Changes in v6:
- Fixed hwmon device name replacing dashes with underscores.
- Removed module verion.
- Fixed condition for asus_wmi_ec_Sensors in KBuild.

For the series:

Quoted 25 lines

Changes in v5:
- Place the sensors bitset directly into the driver_data field of the dmi_system_id struct.
- Replace doc comments with regular ones.

Changes in v4:
- Deprecate the wmi driver rather than removing it.

Changes in v3:
- Remove BIOS version checks and BIOS version dependent mutex path.

Changes in v2:
- Replace sensor flags enum with bitset
- Replace module init/probe functions with module_platform_driver_probe and ask the platform drivers framework to load the driver when ACPI EC is found (ACPI ID "PNP0C09").
- Extend board data with BIOS version attribute for the mutex path to be BIOS version dependent.
- Add module parameter to override the mutex path.

Eugene Shalygin (3):
hwmon: (asus-ec-sensors) add driver for ASUS EC
hwmon: (asus-ec-sensors) update documentation
hwmon: deprecate asis_wmi_ec_sensors driver

Quoted 10 lines
 Documentation/hwmon/asus_ec_sensors.rst     |  51 ++
 Documentation/hwmon/asus_wmi_ec_sensors.rst |  38 --
 MAINTAINERS                                 |   6 +
 drivers/hwmon/Kconfig                       |  16 +-
 drivers/hwmon/Makefile                      |   1 +
 drivers/hwmon/asus-ec-sensors.c             | 690 ++++++++++++++++++++
 6 files changed, 763 insertions(+), 39 deletions(-)
 create mode 100644 Documentation/hwmon/asus_ec_sensors.rst
 delete mode 100644 Documentation/hwmon/asus_wmi_ec_sensors.rst
 create mode 100644 drivers/hwmon/asus-ec-sensors.c

Thanks.

Signature · 1 line
Oleksandr Natalenko (post-factum)
author maintainer
#6 lore raw
In reply to Eugene Shalygin

Günter,

I received data for one more board (ROG STRIX X570-F GAMING [1]), thus shall I update the patch set now, update only two patches (source and doc), or let you finish with these changes and then send out a little addition [2] later on?

Thank you,
Eugene

[1] https://github.com/zeule/asus-ec-sensors/issues/10
[2] https://github.com/zeule/asus-ec-sensors/commit/d45be0a21f47b26727b87d3d111304d0533beacf

maintainer
#7 lore raw
Quoted 7 lines · Eugene Shalygin

Günter,

I received data for one more board (ROG STRIX X570-F GAMING [1]), thus shall I update the patch set now, update only two patches (source and doc), or let you finish with these changes and then send out a little addition [2] later on?

For whatever reason the last patch is unsigned and does not include a description, so you will have to resend anyway.

Guenter

Quoted 6 lines

Thank you,
Eugene

[1] https://github.com/zeule/asus-ec-sensors/issues/10
[2] https://github.com/zeule/asus-ec-sensors/commit/d45be0a21f47b26727b87d3d111304d0533beacf

author maintainer
#8 lore raw
Quoted 2 lines

For whatever reason the last patch is unsigned and does not include a description, so you will have to resend anyway.

Sorry, I had not checked that last commit. Resended as v7 with the new board added and the commit message fixed.

Eugene