Skip to contentSkip to conversation

staging: new asus fan driver

PATCH Superseded Felipe Contreras 3 participants 9 messages Nov 5, 2013 – Nov 6, 2013 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: new asus fan driver

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

[1] http://article.gmane.org/gmane.linux.power-management.general/36774
[2] http://article.gmane.org/gmane.linux.kernel/1576463

 drivers/staging/Kconfig                     |   2 +
 drivers/staging/Makefile                    |   1 +
 drivers/staging/asus-thermal/Kconfig        |   7 ++
 drivers/staging/asus-thermal/asus_thermal.c | 166 ++++++++++++++++++++++++++++
 4 files changed, 176 insertions(+)
 create mode 100644 drivers/staging/asus-thermal/Kconfig
 create mode 100644 drivers/staging/asus-thermal/asus_thermal.c
drivers/staging/Kconfig +2 -0
index 3626dbc8..b245af5 100644
@@ -148,4 +148,6 @@ source "drivers/staging/dgnc/Kconfig"
 
 source "drivers/staging/dgap/Kconfig"
 
+source "drivers/staging/asus-thermal/Kconfig"
+
 endif # STAGING
drivers/staging/Makefile +1 -0
index d1b4b80..70e4456 100644
@@ -66,3 +66,4 @@ obj-$(CONFIG_USB_BTMTK)		+= btmtk_usb/
 obj-$(CONFIG_XILLYBUS)		+= xillybus/
 obj-$(CONFIG_DGNC)			+= dgnc/
 obj-$(CONFIG_DGAP)			+= dgap/
+obj-$(CONFIG_ASUS_THERMAL)	+= asus-thermal/
drivers/staging/asus-thermal/Kconfig new file +7 -0
new file mode 100644
index 0000000..8bf7db4
@@ -0,0 +1,7 @@
+config ASUS_THERMAL
+	tristate "ASUS thermal driver"
+	depends on THERMAL
+	depends on X86
+	help
+	  Enables control of the fan in ASUS laptops.
+
drivers/staging/asus-thermal/asus_thermal.c new file +166 -0

166 lines not on this page · raw message

Signature · 1 line
1.8.4.2+fc1
#1 lore raw
Quoted 13 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Quoted 7 lines

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

Quoted 8 lines

[1] http://article.gmane.org/gmane.linux.power-management.general/36774
[2] http://article.gmane.org/gmane.linux.kernel/1576463

 drivers/staging/Kconfig                     |   2 +
 drivers/staging/Makefile                    |   1 +
 drivers/staging/asus-thermal/Kconfig        |   7 ++
 drivers/staging/asus-thermal/asus_thermal.c | 166 ++++++++++++++++++++++++++++

I need a TODO file for a staging driver listing who is responsible for it, and what is needed to be done to it in order to get it out of staging.

thanks,

greg k-h

#2 lore raw
Quoted 19 lines · Greg Kroah-Hartman
Quoted 18 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Quoted 4 lines
Quoted 2 lines

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Quoted 11 lines
Quoted 7 lines

[1] http://article.gmane.org/gmane.linux.power-management.general/36774
[2] http://article.gmane.org/gmane.linux.kernel/1576463

 drivers/staging/Kconfig                     |   2 +
 drivers/staging/Makefile                    |   1 +
 drivers/staging/asus-thermal/Kconfig        |   7 ++
 drivers/staging/asus-thermal/asus_thermal.c | 166 ++++++++++++++++++++++++++++

I need a TODO file for a staging driver listing who is responsible for it, and what is needed to be done to it in order to get it out of staging.

Done.

Signature · 1 line
Felipe Contreras
#3 lore raw
Quoted 21 lines · Felipe Contreras
Quoted 19 lines · Greg Kroah-Hartman
Quoted 18 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Then why not just merge this to the proper place, instead of relying on staging? I don't want to have to have a staging driver that is waiting on external things to get it merged, instead of issues with the driver itself, as you are now putting the burden of maintenance on me, for no good reason other than you being too "lazy" to get other stuff done :)

So, I really don't want this driver, sorry, please merge it to the "proper" place in the kernel itself, fixing up the ACPI core to do so, or just living with the driver as-is if you don't want to do that work...

greg k-h

#4 lore raw
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Felipe Contreras
Quoted 23 lines · Greg Kroah-Hartman
Quoted 13 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Quoted 7 lines

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

Quoted 8 lines
Quoted 2 lines

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Then why not just merge this to the proper place, instead of relying on staging? I don't want to have to have a staging driver that is waiting on external things to get it merged, instead of issues with the driver itself, as you are now putting the burden of maintenance on me, for no good reason other than you being too "lazy" to get other stuff done :)

*I* am too lazy? I am doing all the work. Nobody else is doing anything about it.

Linux is throttling the CPU speed of this machine without trying to to increase the fan speed first, that is not ideal.

So I do the first step of writing the fan driver and I get told it shouldn't be a separate driver, it should be part of wmi, only to be told later by the same person that it doesn't belong in wmi when I put it there. Then I get told virt_to_physical() is not good, and it should move to staging, and then I'm told you don't want it.

And at no point in time has anybody helped an iota to actually solve the throttling problem.

So much for collaborative effort.

Quoted 4 lines

So, I really don't want this driver, sorry, please merge it to the "proper" place in the kernel itself, fixing up the ACPI core to do so, or just living with the driver as-is if you don't want to do that work...

Forget it, I was hoping other people could use the driver while somebody explains to me how to plug it o the thermal framework so it gets activated when the machine gets hot, but clearly that's not going to happen.

I have done my fair share of collaboration.

I'll just keep the driver for myself and figure out how to solve the throttling by myself, which apparently I have to do anyway.

Cheers.

Signature · 1 line
Felipe Contreras
#5 lore raw
Quoted 41 lines · Felipe Contreras
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Felipe Contreras
Quoted 23 lines · Greg Kroah-Hartman
Quoted 13 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Quoted 7 lines

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

Quoted 8 lines
Quoted 2 lines

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Then why not just merge this to the proper place, instead of relying on staging? I don't want to have to have a staging driver that is waiting on external things to get it merged, instead of issues with the driver itself, as you are now putting the burden of maintenance on me, for no good reason other than you being too "lazy" to get other stuff done :)

*I* am too lazy? I am doing all the work. Nobody else is doing anything about it.

Quoted 8 lines

Linux is throttling the CPU speed of this machine without trying to to increase the fan speed first, that is not ideal.

So I do the first step of writing the fan driver and I get told it shouldn't be a separate driver, it should be part of wmi, only to be told later by the same person that it doesn't belong in wmi when I put it there. Then I get told virt_to_physical() is not good, and it should move to staging, and then I'm told you don't want it.

Who told you to put it in staging? That is the person that needs to be corrected here, it's not your issue, sorry, I didn't realize the backstory here.

And I would push back on those people, if it solves your problem, and there's no other good solution, then it should go into the "real" part of the kernel. Who has rejected this driver and for what reason?

greg k-h

#6 lore raw
Quoted 51 lines · Greg Kroah-Hartman
Quoted 41 lines · Felipe Contreras
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Felipe Contreras
Quoted 23 lines · Greg Kroah-Hartman
Quoted 13 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Quoted 7 lines

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

Quoted 8 lines
Quoted 2 lines

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Then why not just merge this to the proper place, instead of relying on staging? I don't want to have to have a staging driver that is waiting on external things to get it merged, instead of issues with the driver itself, as you are now putting the burden of maintenance on me, for no good reason other than you being too "lazy" to get other stuff done :)

*I* am too lazy? I am doing all the work. Nobody else is doing anything about it.

Quoted 8 lines

Linux is throttling the CPU speed of this machine without trying to to increase the fan speed first, that is not ideal.

So I do the first step of writing the fan driver and I get told it shouldn't be a separate driver, it should be part of wmi, only to be told later by the same person that it doesn't belong in wmi when I put it there. Then I get told virt_to_physical() is not good, and it should move to staging, and then I'm told you don't want it.

Quoted 3 lines

Who told you to put it in staging? That is the person that needs to be corrected here, it's not your issue, sorry, I didn't realize the backstory here.

Matthew Garrett. He said I should wrap my wmi fan code [1], so that it compiles only when staging. I was doing that when I realized how ugly it would all be, and there doesn't seem to be any precedent for that, so I just wrote it as a separate driver.

Quoted 3 lines

And I would push back on those people, if it solves your problem, and there's no other good solution, then it should go into the "real" part of the kernel. Who has rejected this driver and for what reason?

Matthew Garrett. Because as it's described in the TODO, this code is passing a physical address of our structs to the ACPI code, but that's what the DSDT expects, there's no way around it. Doing virt_to_phys() and passing that to the ACPI code might be a little ugly, but as far as I know there's checks already in place.

Matthew said the acpica code is the one that should be doing the virt_to_phys() conversion, which is probably true, but since nobody is going to do that, the task is left for me.

Before going into this daunting task, I would rather have the CPU throttling fixed by hooking the fan to a thermal zone, which was my motivation of starting it in the first place, but I have not received any help as to how to do that, I was hoping having the driver land somewhere (e.g. staging) might help to get the first part out of the way, and concentrate on how to actually make it useful.

[1] http://article.gmane.org/gmane.linux.power-management.general/39522

Signature · 1 line
Felipe Contreras
#7 lore raw
Quoted 66 lines · Felipe Contreras
Quoted 51 lines · Greg Kroah-Hartman
Quoted 41 lines · Felipe Contreras
Quoted 27 lines · Greg Kroah-Hartman
Quoted 26 lines · Felipe Contreras
Quoted 23 lines · Greg Kroah-Hartman
Quoted 13 lines · Felipe Contreras

Simple driver to enable control of the fan in ASUS laptops. So far this has only been tested in ASUS Zenbook Prime UX31A, but according to some online reference [1], it should work in other models as well.

The implementation is very straight-forward, the only caveat is that the fan speed needs to be saved after it has been manually changed because it won't be reported properly until it goes back to 'auto' mode.

[1] http://forum.notebookreview.com/asus/705656-fan-control-asus-prime-ux31-ux31a-ux32a-ux32vd.html

---

Quoted 7 lines

Two incarnations of this code exists [1][2], one that used ACPI methods directly, and one through WMI. Unfortunately the WMI version needs us to pass physicall addresses which is not exactly clean, and that's the only reason the code is proposed for staging.

Most likely this cannot graduate until acpica gets support to receive virtual addresses.

When is that going to happen?

Quoted 8 lines
Quoted 2 lines

I don't know. Presumably when I get it done, which might be never, or a few days from now. Most likely it will take some time.

Then why not just merge this to the proper place, instead of relying on staging? I don't want to have to have a staging driver that is waiting on external things to get it merged, instead of issues with the driver itself, as you are now putting the burden of maintenance on me, for no good reason other than you being too "lazy" to get other stuff done :)

*I* am too lazy? I am doing all the work. Nobody else is doing anything about it.

Quoted 8 lines

Linux is throttling the CPU speed of this machine without trying to to increase the fan speed first, that is not ideal.

So I do the first step of writing the fan driver and I get told it shouldn't be a separate driver, it should be part of wmi, only to be told later by the same person that it doesn't belong in wmi when I put it there. Then I get told virt_to_physical() is not good, and it should move to staging, and then I'm told you don't want it.

Quoted 3 lines

Who told you to put it in staging? That is the person that needs to be corrected here, it's not your issue, sorry, I didn't realize the backstory here.

Matthew Garrett. He said I should wrap my wmi fan code [1], so that it compiles only when staging. I was doing that when I realized how ugly it would all be, and there doesn't seem to be any precedent for that, so I just wrote it as a separate driver.

Quoted 3 lines

And I would push back on those people, if it solves your problem, and there's no other good solution, then it should go into the "real" part of the kernel. Who has rejected this driver and for what reason?

Quoted 5 lines

Matthew Garrett. Because as it's described in the TODO, this code is passing a physical address of our structs to the ACPI code, but that's what the DSDT expects, there's no way around it. Doing virt_to_phys() and passing that to the ACPI code might be a little ugly, but as far as I know there's checks already in place.

Crap, I just spent the day, and a car-ride with Matthew, today, I could have discussed this with him...

Matthew, please don't push drivers to the staging tree that have no problems on their own, and don't require work within them to get out of staging, as that doesn't help much, as I don't want to take code that has to wait for external things to happen before it can move out of staging.

thanks,

greg k-h

#8 lore raw
Quoted 5 lines · Greg Kroah-Hartman

Matthew, please don't push drivers to the staging tree that have no problems on their own, and don't require work within them to get out of staging, as that doesn't help much, as I don't want to take code that has to wait for external things to happen before it can move out of staging.

I'm not willing to commit to supporting this code with the virt_to_phys() hack in place, but I also don't want to block Felipe from having an incentive to fix up the ACPI core so we can do this cleanly. What I suggested was adding it to the asus-wmi driver and wrapping the functionality with CONFIG_STAGING in order to indicate that there were no promises that this feature would remain, and then giving Felipe a few months to do the ACPI work. If it got done in a reasonable time then we'd keep the code, and if not I'd drop it. I certainly didn't suggest writing a separate driver, let alone putting it in staging.

Signature · 1 line
Matthew Garrett | [email protected]