Why is wmi_bus_type not exported?
Hi,
quick learning question: Why is wmi_bus_type not exported unlike, for example, acpi_bus_type, and platform_bus_type?
Wanted to use bus_find_device_by_name in an acpi driver that might need additional infos from a wmi interface that might or might not be present.
Kind regards,
Werner Sembach
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 5 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?
Quoted 9 lines
Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Kind regards,
Werner Sembach
What kind of information do you have in mind? wmi_bus_type is not being exported for historic reasons, i can change that if necessary.
Thanks,
Armin Wolf
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.
Quoted 6 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using bus_find_device_by_name.
Quoted 4 lines
Thanks,
Armin Wolf
Kind regards,
Werner
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.
Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
Thanks,
Armin Wolf
Quoted 9 lines
Quoted 4 lines
Thanks,
Armin WolfKind regards,
Werner
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 29 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 6 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans bool GMOD(): Get current SMOD setting
int GCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
void SSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speed
v2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)
Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Kind regards,
Werner
Quoted 13 lines
Thanks,
Armin WolfQuoted 9 lines
Quoted 4 lines
Thanks,
Armin WolfKind regards,
Werner
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 85 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 29 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit f97e058cfe80 ("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Maybe we can keep the retrieval of the fanX_max values out of the kernel? I propose the following:
- have a driver for your generic ACPI interface
- have a driver for the WMI interface (with fanX_max hwmon attributes)
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the fanX_max attributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposes fanX_max and fanX_target hwmon attributes themself and the userspace application uses them directly.
This would keep the kernel drivers simple.
I suppose you provide some sort of OEM application for fan control? In this case having the fanX_max handling here also gives you full control and allows you to stay independent from the kernel development in that regard. For example you might decide independently to hardcode the max. RPM values on some machines (like the two new machines) or use a different hwmon chip on some other machine.
Aside from that, i really like your approach with having a generic ACPI interface, it can potentially save you a lot of work once you have the initial driver.
Thanks,
Armin Wolf
Quoted 13 lines
Quoted 13 lines
Thanks,
Armin WolfQuoted 9 lines
Quoted 4 lines
Thanks,
Armin WolfKind regards,
Werner
Am 12.11.24 um 17:31 schrieb Armin Wolf:
Quoted 114 lines
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 85 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 29 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.
Quoted 3 lines
This would keep the kernel drivers simple.
I suppose you provide some sort of OEM application for fan control?
Yes we do.
It would be a little bit harder for 3rd parties wanting to implement the hwmon interface then and i'm also thinking of implementing it in the thermal subsystem (albeit i did not do a proper readup on that system yet so maybe it wont work).
Quoted 7 lines
In this case having the
fanX_maxhandling here also gives
you full control and allows you to stay independent from the kernel development in that regard. For example you might decide independently to hardcode the max. RPM values on some machines (like the two new machines) or use a different hwmon chip on some other machine.Aside from that, i really like your approach with having a generic ACPI interface, it can potentially save you a lot of work once you have the initial driver.
Knock on wood that the generic acpi interface works out ^^.
Quoted 17 lines
Thanks,
Armin WolfQuoted 13 lines
Quoted 13 lines
Thanks,
Armin WolfQuoted 9 lines
Quoted 4 lines
Thanks,
Armin WolfKind regards,
Werner
Quoted 123 lines · Werner Sembach
Am 12.11.24 um 17:31 schrieb Armin Wolf:
Quoted 114 lines
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 85 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 29 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.Quoted 3 lines
This would keep the kernel drivers simple.
I suppose you provide some sort of OEM application for fan control?
Yes we do.
It would be a little bit harder for 3rd parties wanting to implement the hwmon interface then and i'm also thinking of implementing it in the thermal subsystem (albeit i did not do a proper readup on that system yet so maybe it wont work).
Quoted 9 lines
Quoted 7 lines
In this case having the
fanX_maxhandling here also gives
you full control and allows you to stay independent from the kernel development in that regard. For example you might decide independently to hardcode the max. RPM values on some machines (like the two new machines) or use a different hwmon chip on some other machine.Aside from that, i really like your approach with having a generic ACPI interface, it can potentially save you a lot of work once you have the initial driver.
Knock on wood that the generic acpi interface works out ^^.
Quoted 1 line
If you're comfortable sharing - is the "ACPI interface" just a wrapper for an EC interface? Is that EC interface stable? As you're developing directly for Linux, there is also the "possibility" to just interact with the EC directly.
That being said if there is an ACPI abstraction already it is nice that you can tell about it's presence using the ACPI ID reserved for this device interface.
Am 12.11.24 um 18:46 schrieb Mario Limonciello:
Quoted 151 lines · Werner Sembach
Quoted 150 lines
Am 12.11.24 um 17:31 schrieb Armin Wolf:
Quoted 128 lines
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 89 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 33 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 31 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 13 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 11 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for
example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be
present.Quoted 8 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has
a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this
type of action should not be encouraged.Rather drivers that need to interact with one another should pass
data back and forth via exported functions.I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.Quoted 3 lines
This would keep the kernel drivers simple.
I suppose you provide some sort of OEM application for fan control?
Yes we do.
It would be a little bit harder for 3rd parties wanting to implement the hwmon interface then and i'm also thinking of implementing it in the thermal subsystem (albeit i did not do a proper readup on that system yet so maybe it wont work).
Quoted 10 lines
In this case having the
fanX_maxhandling here also gives you full control and allows you to stay independent from the kernel development in that regard. For example you might decide independently to hardcode the max. RPM values on some machines (like the two new machines) or use a different hwmon chip on some other machine.Aside from that, i really like your approach with having a generic ACPI interface, it can potentially save you a lot of work once you have the initial driver.
Quoted 7 lines
Quoted 2 lines
Knock on wood that the generic acpi interface works out ^^.
Quoted 1 line
If you're comfortable sharing - is the "ACPI interface" just a wrapper for an EC interface? Is that EC interface stable? As you're developing directly for Linux, there is also the "possibility" to just interact with the EC directly.
Using a ACPI device is still beneficial since it allows autoloading based on the _HID value.
Quoted 4 lines
That being said if there is an ACPI abstraction already it is nice that you can tell about it's presence using the ACPI ID reserved for this device interface.
Hi All,
Quoted 93 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 85 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 29 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 27 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):
Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)
Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the lm_sensors fancontrol script will work properly.
So NACK from me for exposing fanX_max on a separate hwmon device.
What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global fan_max_values_initialized bool and it can return -EPROBE_DEFER when the bool is not set yet.
This will also require the ACPI driver to have a Kconfig "depends on" the WMI driver but that should be fine.
And then the ACPI driver can simply call the exported helper function to get the max fan values.
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Or maybe just hardcode the max fan values in the ACPI driver if it is only 2 models and the next version of the ACPI interface is supposed to fix this shortcoming ?
Regards,
Hans
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 134 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global
fan_max_values_initializedbool and it can return -EPROBE_DEFER when the bool is not set yet.
Quoted 8 lines
This will also require the ACPI driver to have a
Kconfig"depends on" the WMI driver but that should be fine.And then the ACPI driver can simply call the exported helper function to get the max fan values.
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Problem is that when we really bring over the ACPI interface to other ODMs the WMI driver will no longer be there, that's why I wanted to avoid a static dependency on the WMI module to be able to reuse the code.
Quoted 4 lines
Or maybe just hardcode the max fan values in the ACPI driver if it is only 2 models and the next version of the ACPI interface is supposed to fix this shortcoming ?
Well, at least I hope so.
Quoted 6 lines
Regards,
Hans
Hi,
Quoted 142 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 140 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global
fan_max_values_initializedbool and it can return -EPROBE_DEFER when the bool is not set yet.This will also require the ACPI driver to have a
Kconfig"depends on" the WMI driver but that should be fine.And then the ACPI driver can simply call the exported helper function to get the max fan values.
Quoted 7 lines
Quoted 2 lines
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Problem is that when we really bring over the ACPI interface to other ODMs the WMI driver will no longer be there, that's why I wanted to avoid a static dependency on the WMI module to be able to reuse the code.
I see. But won't we still need the WMI module for older models then ?
Quoted 5 lines
Quoted 3 lines
Or maybe just hardcode the max fan values in the ACPI driver if it is only 2 models and the next version of the ACPI interface is supposed to fix this shortcoming ?
Well, at least I hope so.
Ok, so I think it would be best to just go with hardcoding the fan max value for the 2 models now. We can always switch over to somehow querying this over WMI later if maintaining the hardcoded table does turn out to be more work then expected.
Regards,
Hans
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 144 lines
Hi,
Quoted 141 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 140 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global
fan_max_values_initializedbool and it can return -EPROBE_DEFER when the bool is not set yet.This will also require the ACPI driver to have a
Kconfig"depends on" the WMI driver but that should be fine.And then the ACPI driver can simply call the exported helper function to get the max fan values.
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Problem is that when we really bring over the ACPI interface to other ODMs the WMI driver will no longer be there, that's why I wanted to avoid a static dependency on the WMI module to be able to reuse the code.
I see. But won't we still need the WMI module for older models then ?
But it wouldn't need to be loaded, with the dependency it will always need to be loaded.
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines
Or maybe just hardcode the max fan values in the ACPI driver if it is only 2 models and the next version of the ACPI interface is supposed to fix this shortcoming ?
Well, at least I hope so.
Ok, so I think it would be best to just go with hardcoding the fan max value for the 2 models now. We can always switch over to somehow querying this over WMI later if maintaining the hardcoded table does turn out to be more work then expected.
Ack
Quoted 6 lines
Regards,
Hans
Hi,
Quoted 146 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 144 lines
Hi,
Quoted 141 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 140 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global
fan_max_values_initializedbool and it can return -EPROBE_DEFER when the bool is not set yet.This will also require the ACPI driver to have a
Kconfig"depends on" the WMI driver but that should be fine.And then the ACPI driver can simply call the exported helper function to get the max fan values.
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Problem is that when we really bring over the ACPI interface to other ODMs the WMI driver will no longer be there, that's why I wanted to avoid a static dependency on the WMI module to be able to reuse the code.
I see. But won't we still need the WMI module for older models then ?
But it wouldn't need to be loaded, with the dependency it will always need to be loaded.
Presumably it will be auto-loaded based on the WMI GUID, so even if it has special code in probe() to exit the probe() with -ENODEV on systems where it is not necessary due to the ACPI interface being there, it will still get loaded.
To avoid auto-loading the WMI interface would need to be removed from the ACPI tablets.
And probe() could still store the max fan speeds in a global + set the boolean to indicate the max fan speeds are set before exiting with -ENODEV in that case.
So I think you could still go this route, but simply hardcoding for the 2 models this is necessary for seems more KISS, so IMHO that is probably the way to go for now.
Regards,
Hans
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 134 lines
Hi,
Quoted 131 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 130 lines
Hi,
Quoted 127 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 126 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.
I think there is a misunderstanding here: the hwmon device exported by the WMI interface will also contain temperature and fan speed sensors (provided by the WMI interface), so this would be a standard hwmon device.
The only difference between this hwmon device and the hwmon device exposed by the ACPI interface would be that:
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support the fanx_max attribute
So i think there should be no problem with having two hwmon devices on some models, since both are usable independently from each other.
Thanks,
Armin Wolf
Quoted 42 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
What I think works best in cases like this is to have the wmi-driver expose a function to retrieve the fan max value.
This function can use a static global array of fan max values + a global
fan_max_values_initializedbool and it can return -EPROBE_DEFER when the bool is not set yet.This will also require the ACPI driver to have a
Kconfig"depends on" the WMI driver but that should be fine.And then the ACPI driver can simply call the exported helper function to get the max fan values.
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 2 lines
This sort of cross driver function calling is not ideal, but it is better then poking at a struct device owned by another driver.
Problem is that when we really bring over the ACPI interface to other ODMs the WMI driver will no longer be there, that's why I wanted to avoid a static dependency on the WMI module to be able to reuse the code.
I see. But won't we still need the WMI module for older models then ?
But it wouldn't need to be loaded, with the dependency it will always need to be loaded.
Presumably it will be auto-loaded based on the WMI GUID, so even if it has special code in
probe()to exit theprobe()with-ENODEVon systems where it is not necessary due to the ACPI interface being there, it will still get loaded.To avoid auto-loading the WMI interface would need to be removed from the ACPI tablets.
And
probe()could still store the max fan speeds in a global + set the boolean to indicate the max fan speeds are set before exiting with-ENODEVin that case.So I think you could still go this route, but simply hardcoding for the 2 models this is necessary for seems more KISS, so IMHO that is probably the way to go for now.
Regards,
Hans
Hi,
Quoted 141 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 134 lines
Hi,
Quoted 131 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 130 lines
Hi,
Quoted 127 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 126 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is
wmi_bus_typenot exported unlike, for example,acpi_bus_type, andplatform_bus_type?Wanted to use
bus_find_device_by_namein an acpi driver that might need additional infos from a wmi interface that might or might not be present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface will also contain temperature and fan speed sensors (provided by the WMI interface), so this would be a standard hwmon device.
Quoted 8 lines
The only difference between this hwmon device and the hwmon device exposed by the ACPI interface would be that:
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are usable independently from each other.
Ah I see I thought the suggestion was to have the WMI hwmon interface only export the fanx_max attribute attribute and then require userspace to treat the 2 hwmon interfaces as one.
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device, then the question becomes why have the ACPI hwmon interface there at all ? If it is less functional and duplicate IMHO we should just leave it out ?
I thought the whole idea was to prefer the ACPI interface over the WMI one and only expose a hwmon device backed by the ACPI interface if both are present ?
Regards,
Hans
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 151 lines
Hi,
Quoted 140 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 134 lines
Hi,
Quoted 131 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 130 lines
Hi,
Quoted 127 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 126 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 11 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Quoted 9 lines
Hi,
quick learning question: Why is wmi_bus_type not exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver that might
need additional infos from a wmi interface that might or might not be
present.Quoted 7 lines
Quoted 5 lines
Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_typeis not being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface will also contain temperature and fan speed sensors (provided by the WMI interface), so this would be a standard hwmon device.
Quoted 8 lines
The only difference between this hwmon device and the hwmon device exposed by the ACPI interface would be that:
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are usable independently from each other.
Quoted 7 lines
Ah I see I thought the suggestion was to have the WMI hwmon interface only export the
fanx_maxattribute attribute and then require userspace to treat the 2 hwmon interfaces as one.If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device, then the question becomes why have the ACPI hwmon interface there at all ? If it is less functional and duplicate IMHO we should just leave it out ?
Without knowing the details because a collegue write the wmi code: The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.
Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Regards,
Werner
Quoted 9 lines
I thought the whole idea was to prefer the ACPI interface over the WMI one and only expose a hwmon device backed by the ACPI interface if both are present ?
Regards,
Hans
Hi,
Quoted 158 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 155 lines
Hi,
Quoted 140 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 134 lines
Hi,
Quoted 131 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 130 lines
Hi,
Quoted 127 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 126 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Quoted 18 lines
Am 12.11.24 um 12:52 schrieb Werner Sembach:
Hi,
quick learning question: Why is wmi_bus_type not exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver that might
need additional infos from a wmi interface that might or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind? wmi_bus_type is not
being exported for historic reasons, i can change that if necessary.It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has a slow wmi and a quick acpi interface, however the quick acpi interface can not get the max rpm of the cooling fans, but the wmi interface can.
Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date and it might get multi-odm support, while the wmi interface is and stays odm specific. So my idea was to only couple both drivers in a dynamic way using
bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface will also contain temperature and fan speed sensors (provided by the WMI interface), so this would be a standard hwmon device.
Quoted 8 lines
The only difference between this hwmon device and the hwmon device exposed by the ACPI interface would be that:
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are usable independently from each other.
Ah I see I thought the suggestion was to have the WMI hwmon interface only export the
fanx_maxattribute attribute and then require userspace to treat the 2 hwmon interfaces as one.
Quoted 7 lines
Quoted 3 lines
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device, then the question becomes why have the ACPI hwmon interface there at all ? If it is less functional and duplicate IMHO we should just leave it out ?
Without knowing the details because a collegue write the wmi code: The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.
Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Right, but both offer the same information / functionality right (except for the missing max rpm).
So unless I am missing something if both drivers are loaded then there will be 2 hwmon devices registered with duplicate functionality?
If I have understood that correctly then the WMI interface really should be hidden (the WMI drivers' probe() can simply return -ENODEV without doing anything) when the ACPI interface is there.
We do NOT want 2 hwmon devices with duplicate functionality.
Regards,
Hans
Am 18.11.24 um 12:20 schrieb Hans de Goede:
Quoted 166 lines
Hi,
Quoted 163 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 151 lines
Hi,
Quoted 140 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 134 lines
Hi,
Quoted 131 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 130 lines
Hi,
Quoted 127 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 126 lines
Hi All,
Quoted 90 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 82 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 28 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Quoted 26 lines
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Am 12.11.24 um 12:52 schrieb Werner Sembach:Hi,
quick learning question: Why is wmi_bus_type not exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver that might
need additional infos from a wmi interface that might or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind? wmi_bus_type is not
being exported for historic reasons, i can change that if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1 & 2 which has
a slow wmi and a quick acpi interface, however the quick acpi
interface can not get the max rpm of the cooling fans, but the wmi
interface can.Quoted 7 lines
Quoted 5 lines
Thing is for the acpi driver we might plan an earlier upstream date
and it might get multi-odm support, while the wmi interface is and
stays odm specific. So my idea was to only couple both drivers in a
dynamic way using bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific? Can you elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us in their BIOS blob and we hope that in the future we can carry that API over to other ODMs for future TUXEDO devices.
In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
voidSSPD(int index, int value): Set fan speed target as a fraction of max speed
int GSPD(int index): Get current fan speed target as a fraction of max speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per minute
int GTMP(int index): Get temperature of thing fan with respective index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2, which we might add a future iteration, but, well this bios is now out in the wild. However these released devices have a "get info" function in the wmi code which returns the v2 infos and the max rpm.
I want to write the code in a way that it probes the acpi interface for function existence and wherever something is missing tries to fall back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in tuxedo-drivers) and I would like to keep it that way in honor of KISS.
My plan is that the first time max rpm is pulled the acpi driver uses bus_find_device_* to get the wmi device, if present, and pulls max rpm from the driver data there and copies it over to it's own driver data. If not possible it returns a dummy value or falls back to another method. Maybe a hard coded list of max rpm values, currently only 2 devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan, but it is not an elegant solution as the info is actually there, if you know what i mean?
Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):Quoted 8 lines
The only driver using this was dell-wmi, and it really was a hack. The driver was getting a data attribute from another driver and this type of action should not be encouraged.
Rather drivers that need to interact with one another should pass data back and forth via exported functions.
I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another driver. This usually works until it doesn't for some reason so it should just be avoided.
Quoted 5 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)Quoted 8 lines
The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and reads the
fanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of providing a non standard hwmon interface.
Whatever implementation is written it really MUST follow the standard hwmon API so that any hwmon tools like the
lm_sensorsfancontrol script will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface will also contain temperature and fan speed sensors (provided by the WMI interface), so this would be a standard hwmon device.
Quoted 8 lines
The only difference between this hwmon device and the hwmon device exposed by the ACPI interface would be that:
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are usable independently from each other.
Quoted 7 lines
Ah I see I thought the suggestion was to have the WMI hwmon interface only export the
fanx_maxattribute attribute and then require userspace to treat the 2 hwmon interfaces as one.If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device, then the question becomes why have the ACPI hwmon interface there at all ? If it is less functional and duplicate IMHO we should just leave it out ?
Without knowing the details because a collegue write the wmi code: The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.
Quoted 8 lines
Quoted 1 line
Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Right, but both offer the same information / functionality right (except for the missing max rpm).
So unless I am missing something if both drivers are loaded then there will be 2 hwmon devices registered with duplicate functionality?
If I have understood that correctly then the WMI interface really should be hidden (the WMI drivers'
probe()can simply return-ENODEVwithout doing anything) when the ACPI interface is there.We do NOT want 2 hwmon devices with duplicate functionality.
ack
Quoted 6 lines
Regards,
Hans
Am 18.11.24 um 14:11 schrieb Werner Sembach:
Quoted 242 lines
Am 18.11.24 um 12:20 schrieb Hans de Goede:
Quoted 240 lines
Hi,
Quoted 227 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 219 lines
Hi,
Quoted 202 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 190 lines
Hi,
Quoted 187 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 186 lines
Hi,
Quoted 183 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 182 lines
Hi All,
Quoted 131 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 115 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Quoted 47 lines
Am 12.11.24 um 13:42 schrieb Werner Sembach:
Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Am 12.11.24 um 12:52 schrieb Werner Sembach:Hi,
quick learning question: Why is wmi_bus_type not
exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver
that might
need additional infos from a wmi interface that might
or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_type is not
being exported for historic reasons, i can change that
if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1
& 2 which has
a slow wmi and a quick acpi interface, however the quick
acpi
interface can not get the max rpm of the cooling fans,
but the wmi
interface can.Thing is for the acpi driver we might plan an earlier
upstream date
and it might get multi-odm support, while the wmi
interface is and
stays odm specific. So my idea was to only couple both
drivers in a
dynamic way using bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific?
Can you
elaborate a bit on how the ACPI and the WMI interfaces work?We have an ODM that was willing to include ACPI code by us in their
BIOS blob and we hope that in the future we can carry that API over to
other ODMs for future TUXEDO devices.In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs manually (aka
via the commands below) controlled fans
boolGMOD(): Get current SMOD setting
intGCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan" voidSSPD(int index, int value): Set fan speed target as a fraction of
max speed
int GSPD(int index): Get current fan speed target as a fraction of max
speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in revolutions per
minute
int GTMP(int index): Get temperature of thing fan with respective
index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function even in v2,
which we might add a future iteration, but, well this bios is now out
in the wild. However these released devices have a "get info" function
in the wmi code which returns the v2 infos and the max rpm.I want to write the code in a way that it probes the acpi interface
for function existence and wherever something is missing tries to fall
back to infos gathered from the wmi interface, but that one is implemented in a stand alone module (the tuxedo_nb04_* stuff in
tuxedo-drivers) and I would like to keep it that way in honor of KISS.My plan is that the first time max rpm is pulled the acpi driver uses
bus_find_device_* to get the wmi device, if present, and pulls max rpm
from the driver data there and copies it over to it's own driver data.
If not possible it returns a dummy value or falls back to another
method. Maybe a hard coded list of max rpm values, currently only 2
devices have the new interface, so it wouldn't be a long list. Directly going to the hard coded list is our current fallback plan,
but it is not an elegant solution as the info is actually there, if
you know what i mean?Quoted 4 lines
Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it really was a hack.
The driver was getting a data attribute from another driver and this
type of action should not be encouraged.Quoted 7 lines
Rather drivers that need to interact with one another should pass
data back and forth via exported functions.I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another
driver. This usually works until it doesn't for some reason so it
should just be avoided.Quoted 22 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support
the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and
reads thefanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes
itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes
themself and the userspace application uses them directly.Quoted 1 line
This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of
providing a non standard hwmon interface.Whatever implementation is written it really MUST follow the standard
hwmon API so that any hwmon tools like thelm_sensorsfancontrol script
will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface
will also contain temperature and fan speed sensors (provided by the WMI interface), so
this would be a standard hwmon device.The only difference between this hwmon device and the hwmon device exposed by the ACPI interface
would be that:Quoted 8 lines
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are
usable independently from each other.Ah I see I thought the suggestion was to have the WMI hwmon interface only export
thefanx_maxattribute attribute and then require userspace to treat the 2 hwmon
interfaces as one.Quoted 5 lines
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device,
then the question becomes why have the ACPI hwmon interface there at all ? If it is less
functional and duplicate IMHO we should just leave it out ?Quoted 7 lines
Without knowing the details because a collegue write the wmi code:
The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Right, but both offer the same information / functionality right (except for the missing max rpm).
The ACPI interface allows for manual fan control, something the WMI interface does not support.
Quoted 8 lines
Quoted 8 lines
So unless I am missing something if both drivers are loaded then there will be 2 hwmon devices registered with duplicate functionality?
If I have understood that correctly then the WMI interface really should be hidden (the WMI drivers'
probe()can simply return-ENODEVwithout doing anything) when the ACPI interface is there.We do NOT want 2 hwmon devices with duplicate functionality.
AFAIK i think this should normally be done at the BIOS level, but if only a limited number of devices are affected then this should be fine.
Thanks,
Armin Wolf
Quoted 8 lines
ack
Quoted 6 lines
Regards,
Hans
Am 18.11.24 um 19:25 schrieb Armin Wolf:
Quoted 239 lines
Am 18.11.24 um 14:11 schrieb Werner Sembach:
Quoted 237 lines
Am 18.11.24 um 12:20 schrieb Hans de Goede:
Quoted 235 lines
Hi,
Quoted 232 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 219 lines
Hi,
Quoted 202 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 190 lines
Hi,
Quoted 187 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 186 lines
Hi,
Quoted 183 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 182 lines
Hi All,
Quoted 131 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Quoted 119 lines
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Am 12.11.24 um 13:42 schrieb Werner Sembach:Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Am 12.11.24 um 12:52 schrieb Werner Sembach:Hi,
quick learning question: Why is wmi_bus_type not
exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver
that might
need additional infos from a wmi interface that might
or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_type is not
being exported for historic reasons, i can change that
if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1
& 2 which has
a slow wmi and a quick acpi interface, however the quick
acpi
interface can not get the max rpm of the cooling fans,
but the wmi
interface can.Thing is for the acpi driver we might plan an earlier
upstream date
and it might get multi-odm support, while the wmi
interface is and
stays odm specific. So my idea was to only couple both
drivers in a
dynamic way using bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific?
Can you
elaborate a bit on how the ACPI and the WMI interfaces work?
We have an ODM that was willing to include ACPI code by us
in their
BIOS blob and we hope that in the future we can carry that
API over to
other ODMs for future TUXEDO devices.In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs
manually (aka
via the commands below) controlled fans
bool GMOD(): Get current SMOD setting
int GCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
void SSPD(int index, int value): Set fan speed target as a
fraction of
max speed
int GSPD(int index): Get current fan speed target as a
fraction of max
speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in
revolutions per
minute
int GTMP(int index): Get temperature of thing fan with
respective
index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function
even in v2,
which we might add a future iteration, but, well this bios
is now out
in the wild. However these released devices have a "get
info" function
in the wmi code which returns the v2 infos and the max rpm.I want to write the code in a way that it probes the acpi
interface
for function existence and wherever something is missing
tries to fall
back to infos gathered from the wmi interface, but that one is
implemented in a stand alone module (the tuxedo_nb04_*
stuff in
tuxedo-drivers) and I would like to keep it that way in
honor of KISS.My plan is that the first time max rpm is pulled the acpi
driver uses
bus_find_device_* to get the wmi device, if present, and
pulls max rpm
from the driver data there and copies it over to it's own
driver data.
If not possible it returns a dummy value or falls back to
another
method. Maybe a hard coded list of max rpm values,
currently only 2
devices have the new interface, so it wouldn't be a long list.
Directly going to the hard coded list is our current
fallback plan,
but it is not an elegant solution as the info is actually
there, if
you know what i mean?Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver, see commit
f97e058cfe80("platform/x86: wmi: Don't allow drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it really was a hack.
The driver was getting a data attribute from another driver and this
type of action should not be encouraged.Quoted 7 lines
Rather drivers that need to interact with one another should pass
data back and forth via exported functions.I would be quite unhappy with drivers interacting with WMI devices without a proper WMI driver, but i can see your point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of another
driver. This usually works until it doesn't for some reason so it
should just be avoided.Quoted 22 lines
Maybe we can keep the retrieval of the
fanX_maxvalues out of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (withfanX_maxhwmon attributes)The driver for the generic ACPI interface exposes the fan speed controls as pwmX attributes if the interface does not support
the "Get Max RPM" function. The userspace application in this case searches for the hwmon chip exposed by the WMI driver and
reads thefanX_maxattributes there. Then the application can convert the target fan speed into values for the pwmX attributes
itself.
If the ACPI interface however supports the "Get Max RPM" function, then it exposesfanX_maxandfanX_targethwmon attributes
themself and the userspace application uses them directly.Quoted 1 line
This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of
providing a non standard hwmon interface.Whatever implementation is written it really MUST follow the standard
hwmon API so that any hwmon tools like thelm_sensorsfancontrol script
will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface
will also contain temperature and fan speed sensors (provided by the WMI interface), so
this would be a standard hwmon device.The only difference between this hwmon device and the hwmon device exposed by the ACPI interface
would be that:Quoted 8 lines
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are
usable independently from each other.Ah I see I thought the suggestion was to have the WMI hwmon interface only export
thefanx_maxattribute attribute and then require userspace to treat the 2 hwmon
interfaces as one.Quoted 5 lines
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device,
then the question becomes why have the ACPI hwmon interface there at all ? If it is less
functional and duplicate IMHO we should just leave it out ?Without knowing the details because a collegue write the wmi code:
The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Right, but both offer the same information / functionality right (except for the missing max rpm).
The ACPI interface allows for manual fan control, something the WMI interface does not support.
oh you got me wrong here: the wmi interface also supports fan control (albeit I'm not sure if it is implemented in tuxedo-drivers)
Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
So unless I am missing something if both drivers are loaded then there will be 2 hwmon devices registered with duplicate functionality?
If I have understood that correctly then the WMI interface really should be hidden (the WMI drivers'
probe()can simply return-ENODEVwithout doing anything) when the ACPI interface is there.We do NOT want 2 hwmon devices with duplicate functionality.
AFAIK i think this should normally be done at the BIOS level, but if only a limited number of devices are affected then this should be fine.
Thanks,
Armin WolfQuoted 8 lines
ack
Quoted 6 lines
Regards,
Hans
Am 18.11.24 um 20:32 schrieb Werner Sembach:
Quoted 246 lines
Am 18.11.24 um 19:25 schrieb Armin Wolf:
Quoted 244 lines
Am 18.11.24 um 14:11 schrieb Werner Sembach:
Quoted 242 lines
Am 18.11.24 um 12:20 schrieb Hans de Goede:
Quoted 240 lines
Hi,
Quoted 237 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 222 lines
Hi,
Quoted 205 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 193 lines
Hi,
Quoted 190 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 189 lines
Hi,
Quoted 186 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 185 lines
Hi All,
Quoted 141 lines · Armin Wolf
Am 12.11.24 um 16:10 schrieb Werner Sembach:
Am 12.11.24 um 13:51 schrieb Armin Wolf:
Am 12.11.24 um 13:42 schrieb Werner Sembach:Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Am 12.11.24 um 12:52 schrieb Werner Sembach:Hi,
quick learning question: Why is wmi_bus_type not
exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver
that might
need additional infos from a wmi interface that might
or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_type is not
being exported for historic reasons, i can change that
if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1
& 2 which has
a slow wmi and a quick acpi interface, however the quick
acpi
interface can not get the max rpm of the cooling fans,
but the wmi
interface can.Thing is for the acpi driver we might plan an earlier
upstream date
and it might get multi-odm support, while the wmi
interface is and
stays odm specific. So my idea was to only couple both
drivers in a
dynamic way using bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific?
Can you
elaborate a bit on how the ACPI and the WMI interfaces
work?
We have an ODM that was willing to include ACPI code by us
in their
BIOS blob and we hope that in the future we can carry that
API over to
other ODMs for future TUXEDO devices.In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs
manually (aka
via the commands below) controlled fans
bool GMOD(): Get current SMOD setting
int GCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
void SSPD(int index, int value): Set fan speed target as a
fraction of
max speed
int GSPD(int index): Get current fan speed target as a
fraction of max
speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in
revolutions per
minute
int GTMP(int index): Get temperature of thing fan with
respective
index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function
even in v2,
which we might add a future iteration, but, well this bios
is now out
in the wild. However these released devices have a "get
info" function
in the wmi code which returns the v2 infos and the max rpm.I want to write the code in a way that it probes the acpi
interface
for function existence and wherever something is missing
tries to fall
back to infos gathered from the wmi interface, but that
one is
implemented in a stand alone module (the tuxedo_nb04_*
stuff in
tuxedo-drivers) and I would like to keep it that way in
honor of KISS.My plan is that the first time max rpm is pulled the acpi
driver uses
bus_find_device_* to get the wmi device, if present, and
pulls max rpm
from the driver data there and copies it over to it's own
driver data.
If not possible it returns a dummy value or falls back to
another
method. Maybe a hard coded list of max rpm values,
currently only 2
devices have the new interface, so it wouldn't be a long
list.
Directly going to the hard coded list is our current
fallback plan,
but it is not an elegant solution as the info is actually
there, if
you know what i mean?Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver,
see commit f97e058cfe80 ("platform/x86: wmi: Don't allow
drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it
really was a hack.
The driver was getting a data attribute from
another driver and this
type of action should not be encouraged.Rather drivers that need to interact with one
another should pass
data back and forth via exported functions.I would be quite unhappy with drivers interacting with WMI
devices without a proper WMI driver, but i can see your
point here.Agreed on that 1 driver should not be poking the [wmi_]dev of another
driver. This usually works until it doesn't for some reason so it
should just be avoided.Quoted 23 lines
Maybe we can keep the retrieval of the fanX_max values out
of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (with fanX_max hwmon
attributes)The driver for the generic ACPI interface exposes the fan
speed controls as pwmX attributes if the interface does not
support
the "Get Max RPM" function. The userspace application in
this case searches for the hwmon chip exposed by the WMI
driver and
reads the fanX_max attributes there. Then the application
can convert the target fan speed into values for the pwmX
attributes
itself.
If the ACPI interface however supports the "Get Max RPM"
function, then it exposes fanX_max and fanX_target hwmon
attributes
themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the cost of
providing a non standard hwmon interface.Whatever implementation is written it really MUST follow the standard
hwmon API so that any hwmon tools like thelm_sensorsfancontrol script
will work properly.So NACK from me for exposing
fanX_maxon a separate hwmon device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface
will also contain temperature and fan speed sensors (provided by the WMI interface), so
this would be a standard hwmon device.The only difference between this hwmon device and the hwmon device exposed by the ACPI interface
would be that:Quoted 8 lines
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are
usable independently from each other.Ah I see I thought the suggestion was to have the WMI hwmon interface only export
thefanx_maxattribute attribute and then require userspace to treat the 2 hwmon
interfaces as one.Quoted 5 lines
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device,
then the question becomes why have the ACPI hwmon interface there at all ? If it is less
functional and duplicate IMHO we should just leave it out ?Without knowing the details because a collegue write the wmi code:
The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
Right, but both offer the same information / functionality right (except for the missing max rpm).
The ACPI interface allows for manual fan control, something the WMI interface does not support.
oh you got me wrong here: the wmi interface also supports fan control (albeit I'm not sure if it is implemented in tuxedo-drivers)
I see, in this case hiding the WMI-based hwmon device would indeed be beneficial to avoid problems should different userspace applications use different hwmon devices for fan control.
Ideally this should happen inside the ACPI BIOS, but we can implement a blacklist if only a limited number of device are affected.
Thanks,
Armin Wolf
Quoted 25 lines
Quoted 24 lines
Quoted 9 lines
Quoted 9 lines
So unless I am missing something if both drivers are loaded then there will be 2 hwmon devices registered with duplicate functionality?
If I have understood that correctly then the WMI interface really should be hidden (the WMI drivers'
probe()can simply return-ENODEVwithout doing anything) when the ACPI interface is there.We do NOT want 2 hwmon devices with duplicate functionality.
AFAIK i think this should normally be done at the BIOS level, but if only a limited number of devices are affected then this should be fine.
Thanks,
Armin WolfQuoted 8 lines
ack
Quoted 6 lines
Regards,
Hans
Hi,
Quoted 253 lines · Armin Wolf
Am 18.11.24 um 20:32 schrieb Werner Sembach:
Quoted 251 lines
Am 18.11.24 um 19:25 schrieb Armin Wolf:
Quoted 249 lines
Am 18.11.24 um 14:11 schrieb Werner Sembach:
Quoted 245 lines
Am 18.11.24 um 12:20 schrieb Hans de Goede:
Quoted 243 lines
Hi,
Quoted 230 lines · Werner Sembach
Hi,
Am 18.11.24 um 12:09 schrieb Hans de Goede:
Quoted 222 lines
Hi,
Quoted 205 lines · Armin Wolf
Am 13.11.24 um 13:12 schrieb Hans de Goede:
Quoted 193 lines
Hi,
Quoted 190 lines · Werner Sembach
Am 13.11.24 um 12:19 schrieb Hans de Goede:
Quoted 189 lines
Hi,
Quoted 186 lines · Werner Sembach
Am 13.11.24 um 12:05 schrieb Hans de Goede:
Quoted 185 lines
Hi All,
On 12-Nov-24 5:31 PM, Armin Wolf wrote:
Am 12.11.24 um 16:10 schrieb Werner Sembach:Am 12.11.24 um 13:51 schrieb Armin Wolf:
Am 12.11.24 um 13:42 schrieb Werner Sembach:Hi,
Am 12.11.24 um 13:01 schrieb Armin Wolf:
Am 12.11.24 um 12:52 schrieb Werner Sembach:Hi,
quick learning question: Why is wmi_bus_type not
exported unlike, for
example, acpi_bus_type, and platform_bus_type?Wanted to use bus_find_device_by_name in an acpi driver
that might
need additional infos from a wmi interface that might
or might not be
present.Kind regards,
Werner Sembach
What kind of information do you have in mind?
wmi_bus_type is not
being exported for historic reasons, i can change that
if necessary.
It's for the tuxedo-drivers part for the Sirius 16 Gen 1
& 2 which has
a slow wmi and a quick acpi interface, however the quick
acpi
interface can not get the max rpm of the cooling fans,
but the wmi
interface can.Thing is for the acpi driver we might plan an earlier
upstream date
and it might get multi-odm support, while the wmi
interface is and
stays odm specific. So my idea was to only couple both
drivers in a
dynamic way using bus_find_device_by_name.Interesting, how is the ACPI interface not ODM specific?
Can you
elaborate a bit on how the ACPI and the WMI interfaces
work?
We have an ODM that was willing to include ACPI code by us
in their
BIOS blob and we hope that in the future we can carry that
API over to
other ODMs for future TUXEDO devices.In pseudocode that API looks like this:
v1:
void SMOD(bool mode): Toggle firmware controlled fans vs
manually (aka
via the commands below) controlled fans
bool GMOD(): Get current SMOD setting
int GCNT(): Get number of fans
enum GTYP(int index): Returns "CPU-fan" or "GPU-fan"
void SSPD(int index, int value): Set fan speed target as a
fraction of
max speed
int GSPD(int index): Get current fan speed target as a
fraction of max
speedv2 same as v1 but with added:
int GRPM(int index): Get current actual fan speed in
revolutions per
minute
int GTMP(int index): Get temperature of thing fan with
respective
index is pointed at (CPU or GPU die, see GTYP)Like I said, what is missing is a "Get Max RPM" function
even in v2,
which we might add a future iteration, but, well this bios
is now out
in the wild. However these released devices have a "get
info" function
in the wmi code which returns the v2 infos and the max rpm.I want to write the code in a way that it probes the acpi
interface
for function existence and wherever something is missing
tries to fall
back to infos gathered from the wmi interface, but that
one is
implemented in a stand alone module (the tuxedo_nb04_*
stuff in
tuxedo-drivers) and I would like to keep it that way in
honor of KISS.My plan is that the first time max rpm is pulled the acpi
driver uses
bus_find_device_* to get the wmi device, if present, and
pulls max rpm
from the driver data there and copies it over to it's own
driver data.
If not possible it returns a dummy value or falls back to
another
method. Maybe a hard coded list of max rpm values,
currently only 2
devices have the new interface, so it wouldn't be a long
list.
Directly going to the hard coded list is our current
fallback plan,
but it is not an elegant solution as the info is actually
there, if
you know what i mean?Kind regards,
Werner
I see, we once had a similar case with the dell-wmi driver,
see commit f97e058cfe80 ("platform/x86: wmi: Don't allow
drivers to get each other's GUIDs"):The only driver using this was dell-wmi, and it
really was a hack.
The driver was getting a data attribute from
another driver and this
type of action should not be encouraged.Rather drivers that need to interact with one
another should pass
data back and forth via exported functions.I would be quite unhappy with drivers interacting with WMI
devices without a proper WMI driver, but i can see your
point here.
Agreed on that 1 driver should not be poking the [wmi_]dev of
another
driver. This usually works until it doesn't for some reason
so it
should just be avoided.Maybe we can keep the retrieval of the fanX_max values out
of the kernel? I propose the following:- have a driver for your generic ACPI interface
- have a driver for the WMI interface (with fanX_max hwmon
attributes)The driver for the generic ACPI interface exposes the fan
speed controls as pwmX attributes if the interface does not
support
the "Get Max RPM" function. The userspace application in
this case searches for the hwmon chip exposed by the WMI
driver and
reads the fanX_max attributes there. Then the application
can convert the target fan speed into values for the pwmX
attributes
itself.
If the ACPI interface however supports the "Get Max RPM"
function, then it exposes fanX_max and fanX_target hwmon
attributes
themself and the userspace application uses them directly.This would keep the kernel drivers simple.
That would indeed keep the kernel drivers simple, but at the
cost of
providing a non standard hwmon interface.Whatever implementation is written it really MUST follow the
standard
hwmon API so that any hwmon tools like the lm_sensors
fancontrol script
will work properly.So NACK from me for exposing fanX_max on a separate hwmon
device.I think there is a misunderstanding here: the hwmon device exported by the WMI interface
will also contain temperature and fan speed sensors (provided by the WMI interface), so
this would be a standard hwmon device.The only difference between this hwmon device and the hwmon device exposed by the ACPI interface
would be that:Quoted 8 lines
- the hwmon interface exposed by the ACPI interface also allows for manual fan control
- the hwmon interface exposed by the ACPI interface does not support thefanx_maxattributeSo i think there should be no problem with having two hwmon devices on some models, since both are
usable independently from each other.Ah I see I thought the suggestion was to have the WMI hwmon interface only export
thefanx_maxattribute attribute and then require userspace to treat the 2 hwmon
interfaces as one.Quoted 5 lines
If you duplicate all the functionality of the ACPI hwmon device on the WMI hwmon device,
then the question becomes why have the ACPI hwmon interface there at all ? If it is less
functional and duplicate IMHO we should just leave it out ?Quoted 7 lines
Without knowing the details because a collegue write the wmi code:
The WMI fucntions are signigifanctly less performant then the acpi ones where it has measurable performance impact to the whole system when you continuously poll them.Luckily the only wmi exclusive information (max rpm) doesn't change and only needs to be polled once during initialization).
Right, but both offer the same information / functionality right (except for the missing max rpm).
The ACPI interface allows for manual fan control, something the WMI interface does not support.
Quoted 7 lines
Quoted 2 lines
oh you got me wrong here: the wmi interface also supports fan control (albeit I'm not sure if it is implemented in tuxedo-drivers)
I see, in this case hiding the WMI-based hwmon device would indeed be beneficial to avoid problems should different userspace applications use different hwmon devices for fan control.
Ideally this should happen inside the ACPI BIOS, but we can implement a blacklist if only a limited number of device are affected.
I don't think we need a deny-list, instead the WMI driver can just check for presence of the new ACPI interface and if that is there exit its probe() with -ENODEV.
This avoids the need to maintain a list.
Regards,
Hans