The fan on this laptop behaves very strangely.
Basically, it works like this:
- the fan is set according to the temperature the computer was at when it woke up (or turned on)
- the fan speed doesn't change, except when it's done explicitly by the BIOS when the temperature passes 80° - it then blows up the fan to full speed, until it gets down to 70 or 75 °C (I'm not sure which)
- the fan maximum speed is also set by the temperature on wake (see below)
There are 6 cooling devices in `/sys/devices/virtual/thermal/`. I don't know what 0 is, but 1 is the screen brightness. 2-5 seem to represent fan speeds, where 5 is the lowest speed, and 2 is the highest.
Right now I'm using a script that looks like this:
echo -n 0 > /sys/devices/virtual/thermal/cooling_device5/cur_state
echo -n 0 > /sys/devices/virtual/thermal/cooling_device4/cur_state
echo -n 0 > /sys/devices/virtual/thermal/cooling_device3/cur_state
echo -n 0 > /sys/devices/virtual/thermal/cooling_device2/cur_state
echo -n 1 > /sys/devices/virtual/thermal/cooling_device5/cur_state
echo -n 1 > /sys/devices/virtual/thermal/cooling_device4/cur_state
echo -n 1 > /sys/devices/virtual/thermal/cooling_device3/cur_state
echo -n 1 > /sys/devices/virtual/thermal/cooling_device2/cur_state
I call it every minute (as root).
It turns off the fan completely, and then adds speed. Something won't let it behind a certain limit (it usually doesn't go all the way to 1111, but stops at 0011 or 0111), and that limit is usually the speed the fan should be at.
To an observer the fan just changes speeds with this script. It doesn't turn off for a moment or whatever, it just goes faster or slower as it's supposed to.
HOWEVER, there seems to be a hard limit, which is set by the temperature at wake. If the temperature is very low (e.g. when I wake my laptop from sleep after letting it sleeping for a long time), the limit is on 0001 and sometimes even 0000. The laptop then gets hotter and hotter until the BIOS doesn't turn up the emergency cooling (full speed fan when 85°C are reached). When the laptop cools to ~75°C, it turns off again.
The only solution is to wake it up at a higher temperature.
NOTE0: Sometimes, on wake the fan is improperly set, especially in high temperatures. The kernel sets it quite low, but as soon as the script runs it goes quiet quick to get the temperature down.
NOTE1: The cooling device order isn't always as above. Rarely it mixes up, and then the script flashes every minute because of the script. To solve it, I have to reboot.
Without this hard limit, this laptop would be completely usable with the above script. It is a real pain in the butt to suspend and wake the laptop all the time just to get the temperature right.
If you need any more info, just ask.
I forgot to add that this machine came preloaded with Windows Vista Home Edition, where the fan works flawlessly. Because of that I set the acpi_osi to Windows 2006. I'm not sure if that changed anything, but I left it as that just in case.
Also, the fan support used to be much worse in the past. On wake it sometimes used to go full speed without stopping, and the only solution was to either play with the cooling devices or suspend and wake the laptop.
Running Arch Linux.
You're another victim of HP/Compaq BIOS issues... Welcome! ;-)
Please give the three patches attached to the following Bug Comments a try:
They should solve your problem. I'm using them with 3.19.4 on a HP/Compaq 6730b without any more issues.
Thanks! You have no idea how you pleased me with these news. I was losing hope.
If I understand right, I need to patch up the linux source with those patches and compile it? If so I just need to change the PKGBUILD slighly. Any idea when they will be merged?
Yes, patch the kernel with the tree ones (and maybe look at that the code is applied correctly, as they're intended for kernel 4.0.0).
Originally, Rui Zhang wanted to get them into 4.0.0, but it seems like they're not the absolutely final version. So, we'll have to wait a little longer and be glad with what we have now. ;-)
I hope this solution works for you!
OK, just compiled. It was worth the waiting (3+ hours of compiling dude). It works perfectly.
If Rui needs some feedback, the only amiss is that it takes some seconds (2-3) for the fan speed to change according to the temperature on wake from RAM. Otherwise, it's damn perfect.
Oh no. Just woke the laptop up from cold sleep, and the fan went nice and quiet, but the temperature went all the way up to 70°C and the speed didn't change...
O.k. If you've still some patience... you can try the patch from Comment https://bugzilla.kernel.org/show_bug.cgi?id=91411#c67 on top of the first three ones.
Rui first named it "debug patch" and later more decriptively "locking fix" (https://bugzilla.kernel.org/show_bug.cgi?id=91411#c90). I didn't need it on my machine, but also have tested it on top of the others -- without issues (means: no deadlocks and correct beahviour).
I wish that this would help!
Don't worry, I had patience for about a year, I'm not gonna lose it now ;)
I'll try to compile it again. Fingers crossed!
OK. So now I'm running a 3.19 kernel with these patches:
In that order.
All works fine, but my system has to wake up at about 65-70°C to start the fans.
OK, the lock issue is definitely still present.
please attach the output of "grep . /sys/class/thermal/thermal*/*"
please also attach the acpidump.
Created attachment 174891 [details]
Uploaded output of `grep . /sys/class/thermal/thermal*/*`
Created attachment 174901 [details]
Uploaded output of `sudo acpidump`
I had to revert back to the first kernel I compiled. The lock fix patch made things much worse. I also cleaned the laptop fan, because it was full of dust, so now it runs at ~50°C.
Also, I forgot to mention that I run a fully updated BIOS, so my results may be different than others.
My BIOS version is F21. I think I've updated it with this (through Windows): http://h20564.www2.hp.com/hpsc/swd/public/detail?sp4ts.oid=3687623&swItemId=ob_108442_1&swEnvOid=2094
Tried compiling again, this time with linux 4.0.1. The version with the 3 patches and the lock fix seems to work better. I think it sets the fan speed at wake better the the one with only the 3 patches, but the lock fix breaks the dynamic fan speed. To change the fan speed I either have to sleep and wake up, or adjust it manually with the method mentioned in the original method, but the lock issue is still present.
I also compiled a version with only the 3 patches, and it seems to work fine.
Mmmmh. Do I understand you correctly, that the 3-patches solution works for you well with kernel 4.0.x?
But that the 4th patch (locking fix) makes the solution fail?
And that the 3-patches-solution didn't work for you @ kernel 3.19.y?
Thanks for clarifying!
Almost. The three patches make the fan dynamically adjust speed, as it should, but the locking issue is still present. Adding the fourth patch breaks the dynamic adjusting, without fixing the lock issue.
Although, though I am not sure, adding the fourth patch seems to make the kernel adjust the fan speed better at wake (it set the fan to level 3 on wake at a high temperature, which I haven't seen without the fourth patch yet), even though it doesn't change until the next wake.
So, if you only use the three patches, intended for kernel submission, everything works for you?
No. Well, almost everything, just that the highest possible fan speed is dependant on the temperature the laptop was at when it woke up.
I don't think so. You can cover the fan's outlet with a piece of paper closely for a while, to find out the maximum fan speed (read below). Our laptops would then cry with 100% fan over time.
What you experience, is IMO only normal adjustment to changed temperatures during suspend/resume cycle.
If you haven't so far used, I can lead you to this: linux/tools/thermal/tmon/ Compile and observe.
I'm a bit disappointed, that Rui doesn't comment.
At least the locking fix patch needs a rework.
(In reply to Manuel Krause from comment #20)
> I don't think so. You can cover the fan's outlet with a piece of paper
> closely for a while, to find out the maximum fan speed (read below). Our
> laptops would then cry with 100% fan over time.
> What you experience, is IMO only normal adjustment to changed temperatures
> during suspend/resume cycle.
> If you haven't so far used, I can lead you to this:
> linux/tools/thermal/tmon/ Compile and observe.
> I'm a bit disappointed, that Rui doesn't comment.
> Best regards,
> Manuel Krause
I'm positive about the highest possible fan speed. If the laptop wakes up cold, maximum speed is maybe at level 2, and it won't go more until the BIOS emergency cooling kicks in. If it wakes up hot, the max speed 3. 4 is the highest speed, but it never goes that high automatically, only with the BIOS emergency.
BTW, the numbers are just examples.
hi, as this is really a long story, can you please file a new bug report, with
1. detailed description of the problem in latest upstream kernel.
2. acpidump output
3. enable thermal dynamic debug, and attach the dmesg output after the problem reproduced.
Hey, sorry, didn't have much time (actually didn't have any time) and the notebook isn't mine anymore, but I did try it and the problem is still there, I'll upload the respective things as soon as I get to them.
Is it really needed to create a new bug report though? The problem is exactly the same.
(In reply to Juraj Fiala from comment #25)
> Hey, sorry, didn't have much time (actually didn't have any time) and the
> notebook isn't mine anymore, but I did try it and the problem is still
> there, I'll upload the respective things as soon as I get to them.
> Is it really needed to create a new bug report though? The problem is
> exactly the same.
as there are a couple of fixes shipped in after the original issue reported, it would be great to start a new thread, with the latest symptom in the latest kernel. Or else, the previous information would be misleading, every time when I try to refresh my memory about what the problem is...
please feel free to file a new bug report if the fan is still not working well in latest upstream kernel.