w83627hf driver: one pwm value, two fan speeds?
Hi,
While trying to control the CPU temperature with the fan speed on a P4P800 motherboard + P4 CPU with the w83627hf driver (kernel 2.6.11-rc4) just like Asus's Q-Fan (see http://www.wingding.demon.nl/
for qfan.rb), I encountered a strange effect.
Doing
cd /sys/devices/platform/i2c-1/1-0290
echo 240 > pwm2
sleep 1
echo 192 > pwm2
.will stabilize at a fanspeed of around 3229, while changing the 240 to 128 will give a fanspeed of around 2136.
Somehow a 'state' is kept somewhere, or the driver has a bug. Is this a known bug?
Regards,
Rutger.
Signature · 3 lines
Rutger Nijlunsing ---------------------------------------------------- never attribute to a conspiracy which can be explained by incompetence ----------------------------------------------------------------------
Quoted 10 lines · Jean Delvare
Hi Rutger,
Quoted 4 lines
While trying to control the CPU temperature with the fan speed on a P4P800 motherboard + P4 CPU with the w83627hf driver (kernel 2.6.11-rc4) just like Asus's Q-Fan (see http://www.wingding.demon.nl/
for qfan.rb), I encountered a strange effect.First of all I'd like to comment on this. Asus' Q-Fan isn't a real thing, it's a marketing name.
I know it is, but casual user don't need to know. People barely know which motherboard they have, let alone which chipset controls their fan. Calling it Q-Fan here has more to do about 'having an archived mailing list for other people to search on'.
Quoted 3 lines
The underlying technology is Winbond's
automatic fan control logic embedded in their Super-I/O chips (W83627THF in your case, if I'm not mistaken).
Yup, using the w83627hf module, that's what I wrote.
Quoted 3 lines
Winbond calls that "Cruise Mode".
In fact there are two of these, thermal cruise mode and fan speed cruise mode. Q-Fan would be thermal cruise mode.
What is the difference? Thermal cruise mode probably adjusts the CPU fan speed according to the CPU temperature, what does 'fan speed cruise mode' do?
Quoted 2 lines
For confirmation, how is Q-Fan presented in Asus' BIOS? I'd guess a "target CPU temperature" to be chosen by the user?
From motherboard manual: Q-Fan can be enabled/disabled, and a low fan speed can be selected: 11/16, 12/16, 13/16, 14/16, 15/16 or full speed. No temperature to be set.
Quoted 3 lines
OTOH is seems that your qfan.rb script is a *software* fan control script, so it's quite different. Our driver doesn't support either cruise mode at the moment.
Yes, it is an software fan control script. What do you mean with 'doesn't support'? It does provide the infrastructure (reading CPU temp, settings the pwm), so it does support it in my views.
Quoted 3 lines
(Also note that we already have two fan control scripts in the
lm_sensorspackage, one written in perl, one in shell, sharing a common configuration file.)
Yes, I tried those some time ago. Didn't work. The pwm setting is non-lineair. I remember not to clearly, but it took a lot of time and didn't work in the end. The script failed to find correspondance between pwm and fan speeds.
Quoted 7 lines
Quoted 7 lines
Doing
cd
/sys/devices/platform/i2c-1/1-0290
echo 240 > pwm2
sleep 1
echo 192 > pwm2
Quoted 8 lines
Quoted 5 lines
.will stabilize at a fanspeed of around 3229, while changing the 240 to 128 will give a fanspeed of around 2136.
Somehow a 'state' is kept somewhere, or the driver has a bug. Is this a known bug?
Not known, first report. I would appreciate additional experimental data:
1* What if you sleep for a longer time between changes, say 5 seconds?
It needs at least 1 second to be repeatable. When taking a shorter time, its not as clearly defined. Taking longer naps than 1 second doesn't change a thing (in the long run).
Quoted 1 line
2* Result of a 240/128 and 128/240 combination.
Testing some combinations (echo ... in one console, watching the RPMs in another one, fan_div is set to 8). Testing, testing, ...
0 or 64 + sleep 5 + 128 gives +-1125RPM.
80 + sleep 5 + 128 gives +-1125RPM.
96 + sleep 5 + 128 gives +-1900RPM. <- change at 96
144 + sleep 5 + 128 gives +-1900RPM.
192 + sleep 5 + 128 gives +-1900RPM.
240 + sleep 5 + 128 gives +-1900RPM.0 or 64 + sleep 5 + 144 gives +-1400RPM.
80 + sleep 5 + 144 gives +-1400RPM.
96 + sleep 5 + 144 gives +-1400RPM.
112 + sleep 5 + 144 gives +-1400RPM.
128 + sleep 5 + 144 gives +-2250RPM. <- change at 128
240 + sleep 5 + 144 gives +-2250RPM.0 + sleep 5 + 176 gives +-1875RPM.
128 + sleep 5 + 176 gives +-1875RPM.
192 + sleep 5 + 176 gives +-1875RPM.
208 + sleep 5 + 176 gives +-1875RPM.
224 + sleep 5 + 176 gives +-2909RPM. <- change at 224
240 + sleep 5 + 176 gives +-2909RPM.0 or 64 + sleep 5 + 192 gives +-2136RPM.
128 + sleep 5 + 192 gives +-2136RPM.
224 + sleep 5 + 192 gives +-2136RPM.
240 + sleep 5 + 192 gives +-3308RPM. <- change at 2400 + sleep 5 + 208 gives +-2350RPM.
128 + sleep 5 + 208 gives +-2350RPM.
192 + sleep 5 + 208 gives +-2350RPM.
240 + sleep 5 + 208 gives +-2350RPM.0 or 64 + sleep 5 + 240 gives +-2760RPM.
128 + sleep 5 + 240 gives +-2760RPM.
192 + sleep 5 + 240 gives +-2760RPM.
224 + sleep 5 + 240 gives +-2760RPM.Strange, the point of change increases faster than the final speed does...
Quoted 2 lines
Make sure you wait long enough before you conclude, fans may take up to a minute to stabilize speed.
I also hear the difference. 3300RPM sounds a lot different from 2100. Furthermore, the speeds stabilize within several seconds; I'm monitoring it myself.
Quoted 2 lines
Did you check that reading from the pwm2 file would always return the last written value?
Yes. the granularity appears to be 16, therefore I write values like 128, 144, 192, ...
This granularity corresponds to the BIOS Q-Fan settings: 11/16 is probably 176, etc.
Quoted 1 line
Are you loading the w83627hf driver with init=0?
No, since I want the Q-Fan disabled since I want to do it myself in software. What should I retry with init=0?
Quoted 3 lines
Could you please provide a dump of your chip?
(isadump0x2950x296)
Good luck :)
root /sys/devices/platform/i2c-1/1-0290# isadump 0x295 0x296
WARNING! Running this program can cause system crashes, data loss and worse! I will probe address register 0x0295 and data register 0x0296. You have five seconds to reconsider and press CTRL-C!
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 ff 01 cf 00 00 00 00 01 01 01 01 3c 3c 0a 0a 10: 01 ff 00 00 00 01 01 3c 43 00 ff ff 24 32 00 e2 20: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe 30: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00 40: 03 00 00 fe ff 00 00 ff 1f 03 89 c4 58 95 00 a3 50: ff ff 80 ff ff ff 00 80 90 70 ff ff 11 84 ff 05 60: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe 70: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00 80: 01 ff 01 cf 00 00 00 00 01 01 01 01 3c 3c 0a 0a 90: 01 ff 00 00 00 01 01 3c 43 00 ff ff 24 32 00 e2
a0: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe
b0: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00
c0: 03 00 00 fe ff 00 00 ff 1f 03 89 c4 58 95 00 a3
d0: ff ff 80 ff ff ff 00 80 90 70 ff ff 11 84 ff 05
e0: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe
f0: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00
Quoted 2 lines
Would you have the possibility to test kernel patches?
No problem.
Signature · 3 lines
Rutger Nijlunsing ---------------------------------- eludias ed dse.nl never attribute to a conspiracy which can be explained by incompetence ----------------------------------------------------------------------
Hi Rutger,
Quoted 5 lines
Quoted 3 lines
The underlying technology is Winbond's
automatic fan control logic embedded in their Super-I/O chips (W83627THF in your case, if I'm not mistaken).Yup, using the w83627hf module, that's what I wrote.
The w83627hf drivers supports more than one chip, namely W83627HF, W83627_T_HF, W836_9_7HF and W836_3_7HF. It happens that the 627THF variant handles fan control differently from the other chips of the family.
Quoted 7 lines
Quoted 3 lines
Winbond calls that "Cruise Mode".
In fact there are two of these, thermal cruise mode and fan speed cruise mode. Q-Fan would be thermal cruise mode.What is the difference? Thermal cruise mode probably adjusts the CPU fan speed according to the CPU temperature, what does 'fan speed cruise mode' do?
Thermal cruise mode adjusts the fan control *outputs* according to the temperature (aiming at a given temperature). Fan speed cruise mode adjusts the fan control ouputs according to the measured fan speed (aiming at a given fan speed).
Quoted 3 lines
Quoted 3 lines
From motherboard manual: Q-Fan can be enabled/disabled, and a low fan speed can be selected: 11/16, 12/16, 13/16, 14/16, 15/16 or full speed. No temperature to be set.
This means that I am wrong, and what Asus names Q-Fan is not an alias for any "cruise mode" but for manual control. As a side note, I wonder how they achieve "full speed" since I cannot find a way to disable fan control according to the datasheet.
I also would like to add that the fan control is NOT PWM-based as I first thought and said. It is DC-based, according to the datasheet. That's quite rare these days. The files are still called pwm* for the sake of compatibility.
Quoted 7 lines
Quoted 3 lines
OTOH is seems that your qfan.rb script is a *software* fan control script, so it's quite different. Our driver doesn't support either cruise mode at the moment.
What do you mean with 'doesn't support'? It does provide the infrastructure (reading CPU temp, settings the pwm), so it does support it in my views.
Automatic modes are not supported. Manual mode is, as you could see.
Fan speed cruise mode has very little interest IMHO, but thermal cruise mode is interesting and supporting this would be a good idea. I would indeed add support if I has a board with such a chip.
Quoted 31 lines
0 or 64 + sleep 5 + 128 gives +-1125RPM. 80 + sleep 5 + 128 gives +-1125RPM. 96 + sleep 5 + 128 gives +-1900RPM. <- change at 96 144 + sleep 5 + 128 gives +-1900RPM. 192 + sleep 5 + 128 gives +-1900RPM. 240 + sleep 5 + 128 gives +-1900RPM.0 or 64 + sleep 5 + 144 gives +-1400RPM. 80 + sleep 5 + 144 gives +-1400RPM. 96 + sleep 5 + 144 gives +-1400RPM. 112 + sleep 5 + 144 gives +-1400RPM. 128 + sleep 5 + 144 gives +-2250RPM. <- change at 128 240 + sleep 5 + 144 gives +-2250RPM.0 + sleep 5 + 176 gives +-1875RPM.
128 + sleep 5 + 176 gives +-1875RPM. 192 + sleep 5 + 176 gives +-1875RPM. 208 + sleep 5 + 176 gives +-1875RPM. 224 + sleep 5 + 176 gives +-2909RPM. <- change at 224 240 + sleep 5 + 176 gives +-2909RPM.0 or 64 + sleep 5 + 192 gives +-2136RPM.
128 + sleep 5 + 192 gives +-2136RPM. 224 + sleep 5 + 192 gives +-2136RPM. 240 + sleep 5 + 192 gives +-3308RPM. <- change at 2400 + sleep 5 + 208 gives +-2350RPM.
128 + sleep 5 + 208 gives +-2350RPM. 192 + sleep 5 + 208 gives +-2350RPM. 240 + sleep 5 + 208 gives +-2350RPM.
Quoted 7 lines
0 or 64 + sleep 5 + 240 gives +-2760RPM.
128 + sleep 5 + 240 gives +-2760RPM. 192 + sleep 5 + 240 gives +-2760RPM. 224 + sleep 5 + 240 gives +-2760RPM.Strange, the point of change increases faster than the final speed does...
Completely strange, I agree. I don't see much logic here. Two comments though:
* The ratio between "low" and "high" speeds for a same output value seems to be always the same (around 1.5).
* The "high" value seems to exceed the max possible value (3308RPM at 192 > 2760RPM et 240). I wouldn't leave the fan in this state, possibly it's running over its design voltage in this situation.
* The W83627HF outputs less than 5V max for the fans. I doubt you have 5V fans, most likely you have 12V fans like everyone. This means that there must be some electronics (maybe a simple amplifier) between the chip and the fan. I start suspecting that this electronics stuff is bogus and causing the trouble.
If you have a voltmeter, I invite you to check the fan output voltage when you play with the pwm2 file (power the fan from somewhere else in the meantime).
Quoted 2 lines
Yes. the granularity appears to be 16, therefore I write values like 128, 144, 192, ...
True, low nibble of the register is unused.
Quoted 2 lines
This granularity corresponds to the BIOS Q-Fan settings: 11/16 is probably 176, etc.
True again.
Quoted 4 lines
Quoted 1 line
Are you loading the w83627hf driver with init=0?
No, since I want the Q-Fan disabled since I want to do it myself in software. What should I retry with init=0?
Please do if possible, and report if it alters the behavior of pwm2.
Quoted 9 lines
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 01 ff 01 cf 00 00 00 00 01 01 01 01 3c 3c 0a 0a 10: 01 ff 00 00 00 01 01 3c 43 00 ff ff 24 32 00 e2 20: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe 30: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00 40: 03 00 00 fe ff 00 00 ff 1f 03 89 c4 58 95 00 a3 50: ff ff 80 ff ff ff 00 80 90 70 ff ff 11 84 ff 05 60: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe 70: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00
Quoted 8 lines
80: 01 ff 01 cf 00 00 00 00 01 01 01 01 3c 3c 0a 0a 90: 01 ff 00 00 00 01 01 3c 43 00 ff ff 24 32 00 e2
a0: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe
b0: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00
c0: 03 00 00 fe ff 00 00 ff 1f 03 89 c4 58 95 00 a3
d0: ff ff 80 ff ff ff 00 80 90 70 ff ff 11 84 ff 05
e0: a3 c4 d2 be ff 0a 00 1e 6f 4f ff f0 00 de 57 fe
f0: c2 2c 20 80 24 71 41 dd 4a 49 08 1a 12 0d 00 00
Looks all OK to me. (Yes, really.)
Signature · 1 line
Jean Delvare
Hi Rutger,
Quoted 4 lines
While trying to control the CPU temperature with the fan speed on a P4P800 motherboard + P4 CPU with the w83627hf driver (kernel 2.6.11-rc4) just like Asus's Q-Fan (see http://www.wingding.demon.nl/
for qfan.rb), I encountered a strange effect.
First of all I'd like to comment on this. Asus' Q-Fan isn't a real thing, it's a marketing name. The underlying technology is Winbond's automatic fan control logic embedded in their Super-I/O chips (W83627THF in your case, if I'm not mistaken). Winbond calls that "Cruise Mode". In fact there are two of these, thermal cruise mode and fan speed cruise mode. Q-Fan would be thermal cruise mode.
For confirmation, how is Q-Fan presented in Asus' BIOS? I'd guess a "target CPU temperature" to be chosen by the user?
OTOH is seems that your qfan.rb script is a *software* fan control script, so it's quite different. Our driver doesn't support either cruise mode at the moment.
(Also note that we already have two fan control scripts in the lm_sensors package, one written in perl, one in shell, sharing a common configuration file.)
Quoted 7 lines
Doing
cd
/sys/devices/platform/i2c-1/1-0290
echo 240 > pwm2
sleep 1
echo 192 > pwm2
Quoted 5 lines
.will stabilize at a fanspeed of around 3229, while changing the 240 to 128 will give a fanspeed of around 2136.
Somehow a 'state' is kept somewhere, or the driver has a bug. Is this a known bug?
Not known, first report. I would appreciate additional experimental data:
1* What if you sleep for a longer time between changes, say 5 seconds? 2* Result of a 240/128 and 128/240 combination.
Make sure you wait long enough before you conclude, fans may take up to a minute to stabilize speed.
Did you check that reading from the pwm2 file would always return the last written value?
Are you loading the w83627hf driver with init=0?
Could you please provide a dump of your chip?
(isadump 0x295 0x296)
Would you have the possibility to test kernel patches?
Thanks,
--
Jean Delvare