Skip to contentSkip to conversation

Update ASUS WMI supported boards

PATCH Superseded Denis Pauk 4 participants 10 messages Oct 10, 2021

Subsystems (3)

v3 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

Denis Pauk

author maintainer
#0 lore raw

v3 cover Update ASUS WMI supported boards

Add support by WMI interface privided by Asus for B550/X570 boards:
* PRIME X570-PRO,
* ROG CROSSHAIR VIII HERO
* ROG CROSSHAIR VIII DARK HERO
* ROG CROSSHAIR VIII FORMULA
* ROG STRIX X570-E GAMING
* ROG STRIX B550-E GAMING

Add support by WMI interface privided by Asus for X370/X470/ B450/X399 boards:
* ROG CROSSHAIR VI HERO,
* PRIME X399-A,
* PRIME X470-PRO,
* ROG CROSSHAIR VI EXTREME,
* ROG CROSSHAIR VI HERO (WI-FI AC),
* ROG CROSSHAIR VII HERO,
* ROG CROSSHAIR VII HERO (WI-FI),
* ROG STRIX B450-E GAMING,
* ROG STRIX B450-F GAMING,
* ROG STRIX B450-I GAMING,
* ROG STRIX X399-E GAMING,
* ROG STRIX X470-F GAMING,
* ROG STRIX X470-I GAMING,
* ROG ZENITH EXTREME,
* ROG ZENITH EXTREME ALPHA.

Could you please review?

---
Changes in v3:
- Use MODULE_DEVICE_TABLE for match devices.
- asus_wmi_ec_sensors: Use get_unaligned_be32 instead incorrectly used get_unaligned_le32.
- Add documentaion for drivers.

Changes in v2:
- asus_wmi_ec_sensors: Rename asus_wmi_sensors to asus_wmi_ec_sensors for B550/X570 boards.
- asus_wmi_ec_sensors: Use utf8s_to_utf16s/utf16s_to_utf8s instead handmade fuctions.
- asus_wmi_ec_sensors: Use post increment.
- asus_wmi_ec_sensors: Use get_unaligned* for convert values.
- asus_wmi_ec_sensors: Use PTR_ERR_OR_ZERO.
- asus_wmi_ec_sensors: Specify per-board sensors in a declarative way (by Eugene Shalygin).
- asus_wmi_sensors: Add support for X370/X470/B450/X399 boards.

---

Denis Pauk (2):
hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.
hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

 Documentation/hwmon/asus_wmi_ec_sensors.rst |  35 ++
 Documentation/hwmon/asus_wmi_sensors.rst    |  62 ++
 MAINTAINERS                                 |   8 +
 drivers/hwmon/Kconfig                       |  22 +
 drivers/hwmon/Makefile                      |   2 +
 drivers/hwmon/asus_wmi_ec_sensors.c         | 659 ++++++++++++++++++++
 drivers/hwmon/asus_wmi_sensors.c            | 635 +++++++++++++++++++
 7 files changed, 1423 insertions(+)
 create mode 100644 Documentation/hwmon/asus_wmi_ec_sensors.rst
 create mode 100644 Documentation/hwmon/asus_wmi_sensors.rst
 create mode 100644 drivers/hwmon/asus_wmi_ec_sensors.c
 create mode 100644 drivers/hwmon/asus_wmi_sensors.c

base-commit: 39b483aa38995329326988cbc4077422bebc175a

Signature · 1 line
2.33.0
author maintainer
#1 lore raw

PATCH v3 1/2 hwmon: (asus_wmi_ec_sensors) Support B550 Asus WMI.

Linux HWMON sensors driver for ASUS motherboards to read sensors from the embedded controller.

Many ASUS motherboards do not publish all the available sensors via the Super I/O chip but the missing ones are available through the embedded controller (EC) registers.

This driver implements reading those sensor data via the WMI method BREC, which is known to be present in all ASUS motherboards based on the AMD 500 series chipsets (and probably is available in other models too). The driver needs to know exact register addresses for the sensors and thus support for each motherboard has to be added explicitly.

The EC registers do not provide critical values for the sensors and as such they are not published to the HWMON.

Supported motherboards:
* PRIME X570-PRO
* ROG CROSSHAIR VIII HERO
* ROG CROSSHAIR VIII DARK HERO
* ROG CROSSHAIR VIII FORMULA
* ROG STRIX X570-E GAMING
* ROG STRIX B550-E GAMING

---
Changes in v3:
- Use MODULE_DEVICE_TABLE for match devices.
- Use get_unaligned_be32 instead incorrectly used get_unaligned_le32.
- Add documentaion for driver.

Changes in v2:
- Use utf8s_to_utf16s/utf16s_to_utf8s instead handmade fuctions.
- Use post increment.
- Use get_unaligned* for convert values.
- Use PTR_ERR_OR_ZERO.
- Specify per-board sensors in a declarative way (by Eugene Shalygin).

---
 Documentation/hwmon/asus_wmi_ec_sensors.rst |  35 ++
 MAINTAINERS                                 |   7 +
 drivers/hwmon/Kconfig                       |  11 +
 drivers/hwmon/Makefile                      |   1 +
 drivers/hwmon/asus_wmi_ec_sensors.c         | 659 ++++++++++++++++++++
 5 files changed, 713 insertions(+)
 create mode 100644 Documentation/hwmon/asus_wmi_ec_sensors.rst
 create mode 100644 drivers/hwmon/asus_wmi_ec_sensors.c
Documentation/hwmon/asus_wmi_ec_sensors.rst new file +35 -0
new file mode 100644
index 000000000000..e4f603804a82
@@ -0,0 +1,35 @@
+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 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
MAINTAINERS +7 -0
index cc5eaf4e65dc..05448435991d 100644
@@ -2937,6 +2937,13 @@ W:	http://acpi4asus.sf.net
 F:	drivers/platform/x86/asus*.c
 F:	drivers/platform/x86/eeepc*.c
 
+ASUS WMI HARDWARE MONITOR DRIVER
+M:	Eugene Shalygin <[email protected]>
+M:	Denis Pauk <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/hwmon/asus_wmi_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 7fde4c6e1e7f..430a438432a0 100644
@@ -2215,6 +2215,17 @@ config SENSORS_ATK0110
 	  This driver can also be built as a module. If so, the module
 	  will be called asus_atk0110.
 
+config SENSORS_ASUS_WMI_EC
+	tristate "ASUS WMI B550/X570"
+	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 can also be built as a module. If so, the module
+	  will be called asus_wmi_sensors_ec.
+
 endif # ACPI
 
 endif # HWMON
drivers/hwmon/Makefile +1 -0
index baee6a8d4dd1..aae2ff5c7335 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_WMI_EC)	+= asus_wmi_ec_sensors.o
 
 # Native drivers
 # asb100, then w83781d go first, as they can override other drivers' addresses.
drivers/hwmon/asus_wmi_ec_sensors.c new file +659 -0

659 lines not on this page · raw message

Signature · 1 line
2.33.0
author maintainer
#2 lore raw

PATCH v3 2/2 hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

In reply to Denis Pauk

Provides a Linux kernel module "asus_wmi_sensors" that provides sensor readouts via ASUS' WMI interface present in the UEFI of X370/X470/B450/X399 Ryzen motherboards.

Supported motherboards:
* ROG CROSSHAIR VI HERO,
* PRIME X399-A,
* PRIME X470-PRO,
* ROG CROSSHAIR VI EXTREME,
* ROG CROSSHAIR VI HERO (WI-FI AC),
* ROG CROSSHAIR VII HERO,
* ROG CROSSHAIR VII HERO (WI-FI),
* ROG STRIX B450-E GAMING,
* ROG STRIX B450-F GAMING,
* ROG STRIX B450-I GAMING,
* ROG STRIX X399-E GAMING,
* ROG STRIX X470-F GAMING,
* ROG STRIX X470-I GAMING,
* ROG ZENITH EXTREME,
* ROG ZENITH EXTREME ALPHA.

---
Changes in v3:
- Use MODULE_DEVICE_TABLE for match devices.
- Add documentaion for driver.

Changes in v2:
- Add module for boards with support of WMI interface returned sensor name and value of sensor..

---
 Documentation/hwmon/asus_wmi_sensors.rst |  62 +++
 MAINTAINERS                              |   1 +
 drivers/hwmon/Kconfig                    |  11 +
 drivers/hwmon/Makefile                   |   1 +
 drivers/hwmon/asus_wmi_sensors.c         | 635 +++++++++++++++++++++++
 5 files changed, 710 insertions(+)
 create mode 100644 Documentation/hwmon/asus_wmi_sensors.rst
 create mode 100644 drivers/hwmon/asus_wmi_sensors.c
Documentation/hwmon/asus_wmi_sensors.rst new file +62 -0
new file mode 100644
index 000000000000..9526239df163
@@ -0,0 +1,62 @@
+Kernel driver asus-wmi-sensors
+=================================
+
+Supported boards:
+ * PRIME X399-A,
+ * PRIME X470-PRO,
+ * ROG CROSSHAIR VI EXTREME,
+ * ROG CROSSHAIR VI HERO,
+ * ROG CROSSHAIR VI HERO (WI-FI AC),
+ * ROG CROSSHAIR VII HERO,
+ * ROG CROSSHAIR VII HERO (WI-FI),
+ * ROG STRIX B450-E GAMING,
+ * ROG STRIX B450-F GAMING,
+ * ROG STRIX B450-I GAMING,
+ * ROG STRIX X399-E GAMING,
+ * ROG STRIX X470-F GAMING,
+ * ROG STRIX X470-I GAMING,
+ * ROG ZENITH EXTREME,
+ * ROG ZENITH EXTREME ALPHA.
+
+Authors:
+        Ed Brindley <[email protected]>
+
+Description:
+------------
+ASUS mainboards publish hardware monitoring information via WMI interface.
+
+ASUS WMI interface provides a methods to get list of sensors and values of
+such, 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:
+ * CPU Core Voltage,
+ * CPU SOC Voltage,
+ * DRAM Voltage,
+ * VDDP Voltage,
+ * 1.8V PLL Voltage,
+ * +12V Voltage,
+ * +5V Voltage,
+ * 3VSB Voltage,
+ * VBAT Voltage,
+ * AVCC3 Voltage,
+ * SB 1.05V Voltage,
+ * CPU Core Voltage,
+ * CPU SOC Voltage,
+ * DRAM Voltage,
+ * CPU Fan RPM,
+ * Chassis Fan 1 RPM,
+ * Chassis Fan 2 RPM,
+ * Chassis Fan 3 RPM,
+ * HAMP Fan RPM,
+ * Water Pump RPM,
+ * CPU OPT RPM,
+ * Water Flow RPM,
+ * AIO Pump RPM,
+ * CPU Temperature,
+ * CPU Socket Temperature,
+ * Motherboard Temperature,
+ * Chipset Temperature,
+ * Tsensor 1 Temperature,
+ * CPU VRM Temperature,
+ * Water In,
+ * Water Out,
+ * CPU VRM Output Current.
MAINTAINERS +1 -0
index 05448435991d..46036c184330 100644
@@ -2943,6 +2943,7 @@ M:	Denis Pauk <[email protected]>
 L:	[email protected]
 S:	Maintained
 F:	drivers/hwmon/asus_wmi_ec_sensors.c
+F:	drivers/hwmon/asus_wmi_sensors.c
 
 ASUS WIRELESS RADIO CONTROL DRIVER
 M:	João Paulo Rechi Vita <[email protected]>
drivers/hwmon/Kconfig +11 -0
index 430a438432a0..461328c4b00a 100644
@@ -2215,6 +2215,17 @@ config SENSORS_ATK0110
 	  This driver can also be built as a module. If so, the module
 	  will be called asus_atk0110.
 
+config SENSORS_ASUS_WMI
+	tristate "ASUS WMI X370/X470/B450/X399"
+	help
+	  If you say yes here you get support for the ACPI hardware monitoring
+	  interface found in X370/X470/B450/X399 ASUS motherboards. This driver
+	  will provide readings of fans, voltages and temperatures through the system
+	  firmware.
+
+	  This driver can also be built as a module. If so, the module
+	  will be called asus_wmi_sensors.
+
 config SENSORS_ASUS_WMI_EC
 	tristate "ASUS WMI B550/X570"
 	help
drivers/hwmon/Makefile +1 -0
index aae2ff5c7335..656a6191a0f8 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_WMI)	+= asus_wmi_sensors.o
 obj-$(CONFIG_SENSORS_ASUS_WMI_EC)	+= asus_wmi_ec_sensors.o
 
 # Native drivers
drivers/hwmon/asus_wmi_sensors.c new file +635 -0

635 lines not on this page · raw message

Signature · 1 line
2.33.0
#3 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

One comment inline.

Quoted 19 lines · Denis Pauk
drivers/hwmon/asus_wmi_sensors.c new file +19 -0
+static struct platform_driver asus_wmi_sensors_platform_driver = {
+	.driver = {
+		.name	= "asus-wmi-sensors",
+	},
+	.probe = asus_wmi_probe,
+};
+
+static struct platform_device *sensors_pdev;
+
+static int __init asus_wmi_init(void)
+{
+	if (!dmi_check_system(asus_wmi_dmi_table))
+		return -ENODEV;
+
+	sensors_pdev = platform_create_bundle(&asus_wmi_sensors_platform_driver,
+					      asus_wmi_probe,
+					      NULL, 0,
+					      NULL, 0);
+

drivers/hwmon/asus_wmi_sensors.c line 631

Quoted 10 lines
drivers/hwmon/asus_wmi_sensors.c new file +10 -0
+	return PTR_ERR_OR_ZERO(sensors_pdev);
+}
+module_init(asus_wmi_init);
+
+static void __exit asus_wmi_exit(void)
+{
+	platform_device_unregister(sensors_pdev);
+	platform_driver_unregister(&asus_wmi_sensors_platform_driver);
+}
+module_exit(asus_wmi_exit);

This should bind to the WMI bus instead of being a platform device. See drivers/platform/x86/gigabyte-wmi.c

(Some goes also for the other driver)

Thomas

maintainer
#4 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Quoted 7 lines · Thomas Weißschuh

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

Not really. If any of those other drivers are pure hwmon drivers, they should reside in drivers/hwmon instead. And, yes, that really includes the gigabyte-wmi driver. We don't have arbitrary drivers in drivers/pci either just because they are drivers for pci devices.

Guenter

Quoted 40 lines

One comment inline.

Quoted 19 lines · Denis Pauk
drivers/hwmon/asus_wmi_sensors.c new file +19 -0
+static struct platform_driver asus_wmi_sensors_platform_driver = {
+	.driver = {
+		.name	= "asus-wmi-sensors",
+	},
+	.probe = asus_wmi_probe,
+};
+
+static struct platform_device *sensors_pdev;
+
+static int __init asus_wmi_init(void)
+{
+	if (!dmi_check_system(asus_wmi_dmi_table))
+		return -ENODEV;
+
+	sensors_pdev = platform_create_bundle(&asus_wmi_sensors_platform_driver,
+					      asus_wmi_probe,
+					      NULL, 0,
+					      NULL, 0);
+

drivers/hwmon/asus_wmi_sensors.c line 631

Quoted 10 lines
drivers/hwmon/asus_wmi_sensors.c new file +10 -0
+	return PTR_ERR_OR_ZERO(sensors_pdev);
+}
+module_init(asus_wmi_init);
+
+static void __exit asus_wmi_exit(void)
+{
+	platform_device_unregister(sensors_pdev);
+	platform_driver_unregister(&asus_wmi_sensors_platform_driver);
+}
+module_exit(asus_wmi_exit);

This should bind to the WMI bus instead of being a platform device. See drivers/platform/x86/gigabyte-wmi.c

(Some goes also for the other driver)

Thomas

#5 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Quoted 9 lines · Guenter Roeck
Quoted 7 lines · Thomas Weißschuh

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

Quoted 4 lines

Not really. If any of those other drivers are pure hwmon drivers, they should reside in drivers/hwmon instead. And, yes, that really includes the gigabyte-wmi driver. We don't have arbitrary drivers in drivers/pci either just because they are drivers for pci devices.

Fair enough.
I suppose it would be too much churn to move gigabyte-wmi to hwmon now though, correct?

Having the platform-driver-x86 on Cc would still be useful as they can provide guidance about using the ACPI/WMI/platform APIs.

For example by using the WMI bus as mentioned in my other mail would allow to completely remove the manually maintained DMI list and instead directly bind to the WMI GUID for any device that supports this GUID.
(This is possible as this WMI API seems to be self-describing, so all specific parameters can be discovered by the driver)

Thomas

maintainer
#6 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Quoted 10 lines · Thomas Weißschuh
Quoted 9 lines · Guenter Roeck
Quoted 7 lines · Thomas Weißschuh

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

Quoted 9 lines
Quoted 4 lines

Not really. If any of those other drivers are pure hwmon drivers, they should reside in drivers/hwmon instead. And, yes, that really includes the gigabyte-wmi driver. We don't have arbitrary drivers in drivers/pci either just because they are drivers for pci devices.

Fair enough.
I suppose it would be too much churn to move gigabyte-wmi to hwmon now though, correct?

Is it ? I don't recall the reason why it was added to drivers/platform/x86 in the first place. I see other single-use wmi drivers in that directory as well (eg xiaomi-wmi, which should be in input). Is there some unwritten rule stating that all wmi drivers shall reside in drivers/platform/x86, no matter what subsystem they touch ?

Quoted 3 lines

Having the platform-driver-x86 on Cc would still be useful as they can provide guidance about using the ACPI/WMI/platform APIs.

Sure, but that is unrelated to the driver location, and the opposite argument can be made as well (that drivers implementing subsystem code should be reviewed by subsystem maintainers). That is a much stronger argument in my opinion.

Guenter

Quoted 8 lines

For example by using the WMI bus as mentioned in my other mail would allow to completely remove the manually maintained DMI list and instead directly bind to the WMI GUID for any device that supports this GUID.
(This is possible as this WMI API seems to be self-describing, so all specific parameters can be discovered by the driver)

Thomas

#7 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Quoted 21 lines · Guenter Roeck
Quoted 10 lines · Thomas Weißschuh
Quoted 9 lines · Guenter Roeck
Quoted 7 lines · Thomas Weißschuh

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

Quoted 9 lines
Quoted 4 lines

Not really. If any of those other drivers are pure hwmon drivers, they should reside in drivers/hwmon instead. And, yes, that really includes the gigabyte-wmi driver. We don't have arbitrary drivers in drivers/pci either just because they are drivers for pci devices.

Fair enough.
I suppose it would be too much churn to move gigabyte-wmi to hwmon now though, correct?

Quoted 5 lines

Is it ? I don't recall the reason why it was added to drivers/platform/x86 in the first place. I see other single-use wmi drivers in that directory as well (eg xiaomi-wmi, which should be in input). Is there some unwritten rule stating that all wmi drivers shall reside in drivers/platform/x86, no matter what subsystem they touch ?

There was no specific reason. I saw all the other WMI drivers in drivers/platform/x86 and added mine there and sent it to the recipients as reported by get_maintainer.pl.

You mentioned that it could move to hwmon but Hans said there are other single-use wmi drivers in drivers/platform/x86 so I left it as is.

If you want me to move it, I'd be happy to do so.

In any case I think it would make sense to have some sort of written and well-known policy about this, though.

Quoted 9 lines
Quoted 3 lines

Having the platform-driver-x86 on Cc would still be useful as they can provide guidance about using the ACPI/WMI/platform APIs.

Sure, but that is unrelated to the driver location, and the opposite argument can be made as well (that drivers implementing subsystem code should be reviewed by subsystem maintainers). That is a much stronger argument in my opinion.

Guenter

Absolutely. I wanted to make two different points in my mail:

1) Maybe the driver should be moved into drivers/platform/x86 as the other (single-use) WMI drivers are living there.
I don't know about any rule demanding that but was mentioning this so it stays consistent.

2) The patch should *also* be reviewed by pdx86 as it is using their infrastructure.
This was not meant to replace any of the hwmon involvement.

For example when I submitted gigabyte-wmi to pdx86 the maintainers they told me to also solicit feedback from you as the hwmon maintainer. And in the end both the hwmon parts (thank you!) and the wmi parts (platform-device vs WMI bus, same as here) were much better than in the first version.

Quoted 5 lines
Quoted 5 lines

For example by using the WMI bus as mentioned in my other mail would allow to completely remove the manually maintained DMI list and instead directly bind to the WMI GUID for any device that supports this GUID.
(This is possible as this WMI API seems to be self-describing, so all specific parameters can be discovered by the driver)

Thomas

maintainer
#8 lore raw

Re: [PATCH v3 2/2] hwmon: (asus_wmi_sensors) Support X370 Asus WMI.

Quoted 28 lines · Thomas Weißschuh
Quoted 21 lines · Guenter Roeck
Quoted 10 lines · Thomas Weißschuh
Quoted 9 lines · Guenter Roeck
Quoted 7 lines · Thomas Weißschuh

Hi,

for WMI drivers the list [email protected] should probably be on CC too.
Also all other WMI drivers, even for hwmon stuff are located in drivers/platform/x86 so it may be better to put it there, too.

Quoted 9 lines
Quoted 4 lines

Not really. If any of those other drivers are pure hwmon drivers, they should reside in drivers/hwmon instead. And, yes, that really includes the gigabyte-wmi driver. We don't have arbitrary drivers in drivers/pci either just because they are drivers for pci devices.

Fair enough.
I suppose it would be too much churn to move gigabyte-wmi to hwmon now though, correct?

Quoted 5 lines

Is it ? I don't recall the reason why it was added to drivers/platform/x86 in the first place. I see other single-use wmi drivers in that directory as well (eg xiaomi-wmi, which should be in input). Is there some unwritten rule stating that all wmi drivers shall reside in drivers/platform/x86, no matter what subsystem they touch ?

Quoted 4 lines

There was no specific reason. I saw all the other WMI drivers in drivers/platform/x86 and added mine there and sent it to the recipients as reported by get_maintainer.pl.

Sorry, that is not a valid reason or argument for me.

Quoted 5 lines

You mentioned that it could move to hwmon but Hans said there are other single-use wmi drivers in drivers/platform/x86 so I left it as is.

If you want me to move it, I'd be happy to do so.

At this point this is out of my control.

Quoted 3 lines

In any case I think it would make sense to have some sort of written and well-known policy about this, though.

Absolutely agree. Historically single-use drivers resided in subsystem directories, and for multi-use drivers it was handled on a case-by-case basis. If that is being changed (meaning subsystem driver control/maintenance/review is taken away from subsystem maintainers), it should for sure be documented.

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Having the platform-driver-x86 on Cc would still be useful as they can provide guidance about using the ACPI/WMI/platform APIs.

Sure, but that is unrelated to the driver location, and the opposite argument can be made as well (that drivers implementing subsystem code should be reviewed by subsystem maintainers). That is a much stronger argument in my opinion.

Quoted 6 lines
Quoted 1 line

Guenter

Absolutely. I wanted to make two different points in my mail:

1) Maybe the driver should be moved into drivers/platform/x86 as the other (single-use) WMI drivers are living there.

Doing something wrong is neither a reason nor an argument to keep doing it.

Quoted 7 lines

I don't know about any rule demanding that but was mentioning this so it stays consistent.

2) The patch should *also* be reviewed by pdx86 as it is using their infrastructure.
This was not meant to replace any of the hwmon involvement.

Quoted 6 lines

For example when I submitted gigabyte-wmi to pdx86 the maintainers they told me to also solicit feedback from you as the hwmon maintainer. And in the end both the hwmon parts (thank you!) and the wmi parts (platform-device vs WMI bus, same as here) were much better than in the first version.

Sure. Unfortunately that is not always the case. Many drivers registering with hwmon were never reviewed by a hwmon maintainer, and some of those make me shiver when I look at them. Since v5.12, get_maintainer.pl lists hwmon maintainers as reviewers if a driver makes a hwmon API call, so hopefully that will help a bit.

Guenter

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

For example by using the WMI bus as mentioned in my other mail would allow to completely remove the manually maintained DMI list and instead directly bind to the WMI GUID for any device that supports this GUID.
(This is possible as this WMI API seems to be self-describing, so all specific parameters can be discovered by the driver)

Thomas

#9 lore raw
In reply to Denis Pauk
Quoted 1 line · On Sunday 10 October 2021 12:52:13 Denis Pauk wrote:

Add support by WMI interface privided by Asus for B550/X570 boards:

...

Quoted 2 lines

Add support by WMI interface privided by Asus for X370/X470/ B450/X399 boards:

...

Quoted 1 line

Hello! Could you provide (at least into bug tracker) MOF definitions of WMI functions? If there are are any issues with driver, definitions of API, functions and buffers could help.