Bug 96881 - HP Compaq 6735s fan issues
Summary: HP Compaq 6735s fan issues
Status: CLOSED OBSOLETE
Alias: None
Product: ACPI
Classification: Unclassified
Component: Power-Fan (show other bugs)
Hardware: All Linux
: P1 high
Assignee: Zhang Rui
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-19 14:34 UTC by Juraj Fiala
Modified: 2016-12-22 01:15 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.19.4-1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Uploaded output of `grep . /sys/class/thermal/thermal*/*` (1.11 KB, text/plain)
2015-04-23 14:55 UTC, Juraj Fiala
Details
Uploaded output of `sudo acpidump` (418.75 KB, text/plain)
2015-04-23 14:56 UTC, Juraj Fiala
Details

Description Juraj Fiala 2015-04-19 14:34:34 UTC
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:

'''
#!/bin/sh

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.

Thanks.
Comment 1 Juraj Fiala 2015-04-19 14:53:15 UTC
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.
Comment 2 Manuel Krause 2015-04-19 17:33:00 UTC
Hello, Juraj! 
You're another victim of HP/Compaq BIOS issues... Welcome! ;-)

Please give the three patches attached to the following Bug Comments a try:
https://bugzilla.kernel.org/show_bug.cgi?id=78201#c183
https://bugzilla.kernel.org/show_bug.cgi?id=78201#c184
https://bugzilla.kernel.org/show_bug.cgi?id=78201#c185

They should solve your problem. I'm using them with 3.19.4 on a HP/Compaq 6730b without any more issues.

Best regards,
Manuel
Comment 3 Juraj Fiala 2015-04-19 18:41:48 UTC
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?
Comment 4 Manuel Krause 2015-04-19 19:37:07 UTC
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!
Comment 5 Juraj Fiala 2015-04-20 16:26:37 UTC
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.
Comment 6 Juraj Fiala 2015-04-20 17:21:21 UTC
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...
Comment 7 Manuel Krause 2015-04-20 22:08:49 UTC
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!
Comment 8 Juraj Fiala 2015-04-21 15:18:28 UTC
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!
Comment 9 Juraj Fiala 2015-04-22 16:12:24 UTC
OK. So now I'm running a 3.19 kernel with these patches:

https://bugzilla.kernel.org/show_bug.cgi?id=78201#c183
https://bugzilla.kernel.org/show_bug.cgi?id=78201#c184
https://bugzilla.kernel.org/show_bug.cgi?id=78201#c185
https://bugzilla.kernel.org/show_bug.cgi?id=91411#c66

In that order.

All works fine, but my system has to wake up at about 65-70°C to start the fans.
Comment 10 Juraj Fiala 2015-04-22 16:51:59 UTC
OK, the lock issue is definitely still present.
Comment 11 Zhang Rui 2015-04-23 04:54:40 UTC
please attach the output of "grep . /sys/class/thermal/thermal*/*"
please also attach the acpidump.
Comment 12 Juraj Fiala 2015-04-23 14:55:15 UTC
Created attachment 174891 [details]
Uploaded output of `grep . /sys/class/thermal/thermal*/*`
Comment 13 Juraj Fiala 2015-04-23 14:56:04 UTC
Created attachment 174901 [details]
Uploaded output of `sudo acpidump`
Comment 14 Juraj Fiala 2015-04-26 10:26:25 UTC
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
Comment 15 Juraj Fiala 2015-05-02 16:41:14 UTC
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.
Comment 16 Manuel Krause 2015-05-03 20:47:41 UTC
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!
Comment 17 Juraj Fiala 2015-05-04 13:38:54 UTC
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.
Comment 18 Manuel Krause 2015-05-05 04:08:16 UTC
So, if you only use the three patches, intended for kernel submission, everything works for you?
Comment 19 Juraj Fiala 2015-05-05 13:38:56 UTC
No. Well, almost everything, just that the highest possible fan speed is dependant on the temperature the laptop was at when it woke up.
Comment 20 Manuel Krause 2015-05-09 19:46:07 UTC
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
Comment 21 Manuel Krause 2015-05-09 19:47:23 UTC
At least the locking fix patch needs a rework.
Comment 22 Juraj Fiala 2015-08-28 14:58:07 UTC
(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.
Comment 23 Zhang Rui 2016-05-09 02:42:59 UTC
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.
Comment 24 Zhang Rui 2016-06-20 02:05:46 UTC
ping...
Comment 25 Juraj Fiala 2016-06-20 14:47:29 UTC
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.
Comment 26 Zhang Rui 2016-06-27 05:28:33 UTC
(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.
> 
great.

> 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...
Comment 27 Zhang Rui 2016-12-22 01:15:27 UTC
bug closed.
please feel free to file a new bug report if the fan is still not working well in latest upstream kernel.

Note You need to log in before you can comment on or make changes to this bug.