All of lore.kernel.org
 help / color / mirror / Atom feed
* smsc47m1 ported to Linux 2.6
@ 2005-05-19  6:25 Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
                   ` (18 more replies)
  0 siblings, 19 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi all,

I just finished a preliminary version of the smsc47m1 driver to Linux
2.6. Patch is available here:

http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-alpha2.diff

It's basically Gabriele Gorla's version, updated to reflect recent
changes to the kernel and fixes to the 2.4 driver, plus some minor
tweaks. As the name says, it's built against 2.6.8-rc2, but any recent
kernel tree (>=2.6.7) should do too.

Note that the patch is completely untested since I don't own a
compatible device myself. But I felt that the port had been pending for
too long and I know that there is an impatient crowd waiting for this
driver to be part of Linux 2.6, so I tried to complete the existing code
into something people could finally try.

Please test if possible, and tell me how it fails for you ;)

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` cgfreita
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi all,

Just updated my smsc47m1 patch after I found some errors in the previous
versions. You can get it here:

http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-alpha3.diff

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (4 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

BTW, I think that there's still something broken in the 2.4 smsc47m1
driver. If I read the datasheets correctly, pwm_enable currently does
what you tell it not to do, ie: 1 will force fan to full speed while 0
will enable PWM.

Can someone (Mark?) confirm?

Thanks,

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (2 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` cgfreita
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi Jean,
	
	Sorry for the long delay.
	I was a little busy here.
	I got the package.
	It patched (no *.rej) and compiled fine.
	Attached is a file with some output from my environment.
	If you need more information, please, tell me. I will try to get it
to you.
	Thank you.

Cheers,

Freitas
	
> Just updated my smsc47m1 patch after I found some errors in the
> previous versions. You can get it here:
> 
> http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-alpha3.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: probs.txt
Type: application/octet-stream
Size: 2273 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040724/ceac300c/probs.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> Sorry for the long delay.
> I was a little busy here.

No problem :)

> I got the package.
> It patched (no *.rej) and compiled fine.
> Attached is a file with some output from my environment.

After both of you reported that fan1 was working OK but fan2 wasn't, I
had to admit that there could be a problem in the driver. It is
theoretically possible that the board maker decides to enable fan1 and
disable fan2 (which is why I didn't react after the first report) but
two reports by two different testers were too much ;)

There was actually a bug in the driver, I wasn't watching the correct
registers when deciding whether to ebable fans or not. Same for PWM
outputs.

This is now fixed in patch tagged beta1:
http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta1.diff

Please test and confirm that both of you now have fan 1 and 2 working,
and two pwm file sets as well (whether they have an actual effect on fans
is yet another matter).

(You can revert the first patch using "patch -R" before applying this
one, so that you won't waste your time getting a fresh new tree.)

Thanks a lot for testing my code.

Among things that can be done to test the driver more actively:

1* Change fan limits in /etc/sensors.conf, run "sensors -s" and check
that the limits have been set properly. Ditto for divisors.

2* Change the fan limits through sysfs directly. Testing of corner cases
is welcome (large values, negative values, zero). Ditto for divisors.

3* Play with PWM (enable/disable, change speed). Be careful not to stop
your fans completely, systems usually don't like that much.

Thanks again.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (3 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` Jean Delvare
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi Jean,

> After both of you reported that fan1 was working OK but fan2 wasn't,
> I had to admit that there could be a problem in the driver. It is
> theoretically possible that the board maker decides to enable fan1
> and disable fan2 (which is why I didn't react after the first
> report) but two reports by two different testers were too much ;)
> 
> There was actually a bug in the driver, I wasn't watching the
> correct registers when deciding whether to ebable fans or not. Same
> for PWM outputs.

	1) I was reading my mainboard manual and I found that there is a
third fan connector (1 processor fan and 2 chassis fans). I have just
two: 1 processor and 1 chassis). I confirmed at the mainboard and the
third connector is really there. I can't test it for now.
	2)Sorry, I didn't understand about PWM outputs. Sorry. :-|
 
> This is now fixed in patch tagged beta1:
> http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta1.diff
> 
> Please test and confirm that both of you now have fan 1 and 2
> working, and two pwm file sets as well (whether they have an actual
> effect on fans is yet another matter).
> 
> (You can revert the first patch using "patch -R" before applying
> this one, so that you won't waste your time getting a fresh new
> tree.)

	I did patch -p1 -R.
	I applied the new one. Applied and compiled fine.
	Please, take a look at probs2.txt attached.
 
> Thanks a lot for testing my code.

	Thanks a lot for coding it. :-)

> Among things that can be done to test the driver more actively:
> 
> 1* Change fan limits in /etc/sensors.conf, run "sensors -s" and
> check that the limits have been set properly. Ditto for divisors.

	As you can see at probs2.txt, I tried some values and there are
diffs between them. (sensors.conf and sensors output)
 
> 2* Change the fan limits through sysfs directly. Testing of corner
> cases is welcome (large values, negative values, zero). Ditto for
> divisors.

	I tried to put values in fan1_min.
	It didn't accepted values less than 1299 and treated it as 1300.
	I tried negative values and it didn't accept it.
	(if you "cat fan1_min" or use sensors command, the output is the
same: 1300)
	(see probs2.txt also)

> 3* Play with PWM (enable/disable, change speed). Be careful not to
> stop your fans completely, systems usually don't like that much.

	As I said, I am not using PWM (power management?), so I don't know
how to try this. Sorry.
	Oh, I am using gkrellm and I can get fans there too. (both) :-)

	If you need more information, please just tell me.

> Thanks again.

	Thanks again, too. :-)

Cheers,

Freitas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: probs2.txt
Type: application/octet-stream
Size: 3461 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040724/eb616bc5/probs2.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` cgfreita
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi Jean,

	I tried some other things.
	I am a little confused. :-)
	I tried some options in /etc/sensors.conf and executed sensors -s
and sensors commands.
	Please, take a look at probs3.txt (attached).
	If you need more information, please tell me.
	Thank you.

Cheers,

Freitas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: probs3.txt
Type: application/octet-stream
Size: 2368 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040724/c707fcc5/probs3.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (5 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Ivars Strazdins
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> 1) I was reading my mainboard manual and I found that there is a
> third fan connector (1 processor fan and 2 chassis fans). I have just
> two: 1 processor and 1 chassis). I confirmed at the mainboard and the
> third connector is really there. I can't test it for now.

I've read the manual too, and it says that fan3 control is optional,
depending on whether you have a 47M132 or 47M142 chip. They also say
that the CPU fan can be monitored but not controled, and that the System
fan can be monitored and controled.

> As you can see at probs2.txt, I tried some values and there are
> diffs between them. (sensors.conf and sensors output)

This is expected. The fan monitoring has limited resolution due to the
way it works. So there's nothing wrong with asking for, say, 2000 and
get 1996 or 2008 in return. It's even more true if you use a high fan
clock divider (say 8).

> I tried to put values in fan1_min.
> It didn't accepted values less than 1299 and treated it as 1300.
> I tried negative values and it didn't accept it.
> (if you "cat fan1_min" or use sensors command, the output is the
> same: 1300)

Fine, that's exactly what was supposed to happen.

Note that the actual min depends on the fan clock divider. I guess you
had a divider of 4.

> As I said, I am not using PWM (power management?), so I don't
> know how to try this. Sorry.

PWM means for "pulse width modulation" and not related to power
management at all. It's a way to control the speed of your fans.

In /sys/bus/i2c/devices/1-0800 you should see files named fan1_pwm and
fan1_pwm_enable. You can change their values to control how fast you
want your fan to spin. That's interesting if your system is not too hot
but a bit noisy. It basically lets you select a temperature/noise
tradeoff.

fan1_pwm_enable can take two values: 0 and 1. 0 means that the fan is
always running at full speed. 1 means that you can control the speed
with the second file, fan1_pwm. fan1_pwm value is between 0 (fan off,
not recommended) and 255 (full speed).

Note that depending on how the motherboard is wires, fan1_pwm can
control fan1 OR a different fan, there's no way to know. Anyway,
according to your motherboard docs, cpu fan speed is not controlable, so
you should be able to play safely with this feature (unless your fans
are not plugged in the correct headers).

If fan1_pwm doesn't seem to have any effect you can try fan2_pwm.

A test sequence would be:
echo 255 > fan1_pwm
cat fan1_pwm (should read 252)
echo 1 > fan1_pwm_enable
cat fan1_pwm_enable (should read 1)
echo 160 > fan1_pwm
cat fan1_pwm (should read 160, fan should slow down)
echo 0 > fan1_pwm_enable
cat fan1_pwm_enable (should read 0, fan should go back to full speed)

You should wait 2 seconds between each command to make sure you read the
values from the chip and not from the cache.

> If you need more information, please just tell me.

Yes. I've updated the patch:
http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta2.diff

I've fixed a number of corner cases, and also added some code so that
changing the fan clock divider should preserve the corresponding fan
min. I'd like you to try that:

echo 8 > fan1_div
cat fan1_div (should read 8)
echo 3000 > fan1_min
cat fan1_min (should read around, but not exactly, 3000)
echo 2 > fan1_div
cat fan1_div (should read 2)
cat fan1_min (should read around, but not exactly, 3000)
echo 4 > fan1_div
cat fan1_div (should read 4)
cat fan1_min (should read around, but not exactly, 3000)

Also, about the logs you sent, I'm a bit surprised about the alarms. You
seem to be as well... Looks like they trigger more often than they
should (i.e. if the fan speed is little above the limit). Could you
please provide a dump of your chip so that I can check why this happens?

isadump -f 0x800 0x80

And if possible the corresponding output of "sensors" with such an alarm
set.

> compute fan2_min (@+4), (@+4)

You can discard that, it's not worth it IMHO. Fan speeds are not exact
values, some noise is expected.

Thanks!

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (9 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` Jean Delvare
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Jean,

> > 1) I was reading my mainboard manual and I found that there is a
> > third fan connector (1 processor fan and 2 chassis fans). I have
> > just two: 1 processor and 1 chassis). I confirmed at the mainboard
> > and the third connector is really there. I can't test it for now.
> 
> I've read the manual too, and it says that fan3 control is optional,
> depending on whether you have a 47M132 or 47M142 chip. They also say
> that the CPU fan can be monitored but not controled, and that the
> System fan can be monitored and controled.

	Great. I was reading the short manual (printed version)
	I was just looking for fan connectors position. But this information
is interesting.

> > I tried to put values in fan1_min.
> > It didn't accepted values less than 1299 and treated it as 1300.
> > I tried negative values and it didn't accept it.
> > (if you "cat fan1_min" or use sensors command, the output is the
> > same: 1300)
> 
> Fine, that's exactly what was supposed to happen.
> 
> Note that the actual min depends on the fan clock divider. I guess
> you had a divider of 4.

	Yes, divider equals to 4. :-)

> > As I said, I am not using PWM (power management?), so I don't
> > know how to try this. Sorry.
> 
> PWM means for "pulse width modulation" and not related to power
> management at all. It's a way to control the speed of your fans.
> 
> In /sys/bus/i2c/devices/1-0800 you should see files named fan1_pwm
> and fan1_pwm_enable. You can change their values to control how fast
> you want your fan to spin. That's interesting if your system is not
> too hot but a bit noisy. It basically lets you select a
> temperature/noise tradeoff.

	I had already seen this files, but I didn't know about PWM meaning.
Thank you.
	I tried to change fan2 and, as we could see, fan2 here, at my
mainboard, means processor fan and, as you told, it can't be turned
off. :-)

> fan1_pwm_enable can take two values: 0 and 1. 0 means that the fan
> is always running at full speed. 1 means that you can control the
> speed with the second file, fan1_pwm. fan1_pwm value is between 0
> (fan off, not recommended) and 255 (full speed).
> 
> Note that depending on how the motherboard is wires, fan1_pwm can
> control fan1 OR a different fan, there's no way to know. Anyway,
> according to your motherboard docs, cpu fan speed is not
> controlable, so you should be able to play safely with this feature
> (unless your fans are not plugged in the correct headers).
> 
> If fan1_pwm doesn't seem to have any effect you can try fan2_pwm.
> 
> A test sequence would be:
> echo 255 > fan1_pwm
> cat fan1_pwm (should read 252)
> echo 1 > fan1_pwm_enable
> cat fan1_pwm_enable (should read 1)
> echo 160 > fan1_pwm
> cat fan1_pwm (should read 160, fan should slow down)
> echo 0 > fan1_pwm_enable
> cat fan1_pwm_enable (should read 0, fan should go back to full
> speed)
>
> You should wait 2 seconds between each command to make sure you read
> the values from the chip and not from the cache.

	I patched -R the last diff.
	I patched with the file below.
	Compiled fine.
	I tried the commands above.
	Just an strange behavior with sensors command information.
	Please, take a look at probs4.txt attached.
 
> Yes. I've updated the patch:
> http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta2.diff
> 
> I've fixed a number of corner cases, and also added some code so
> that changing the fan clock divider should preserve the
> corresponding fan min. I'd like you to try that:
> 
> echo 8 > fan1_div
> cat fan1_div (should read 8)
> echo 3000 > fan1_min
> cat fan1_min (should read around, but not exactly, 3000)
> echo 2 > fan1_div
> cat fan1_div (should read 2)
> cat fan1_min (should read around, but not exactly, 3000)
> echo 4 > fan1_div
> cat fan1_div (should read 4)
> cat fan1_min (should read around, but not exactly, 3000)
> 
> Also, about the logs you sent, I'm a bit surprised about the alarms.
> You seem to be as well... Looks like they trigger more often than
> they should (i.e. if the fan speed is little above the limit). Could
> you please provide a dump of your chip so that I can check why this
> happens?
> 
> isadump -f 0x800 0x80
> 
> And if possible the corresponding output of "sensors" with such an
> alarm set.

	Please, take a look at results_jean.txt and results_jean_dump.txt.

> > compute fan2_min (@+4), (@+4)
> 
> You can discard that, it's not worth it IMHO. Fan speeds are not
> exact values, some noise is expected.

	Discarded. :-)
	All tests I did were made without this line.
	If you need more information, please tell me.
	From today, I can delay a little more to answer because I am back to
college classes. (The end of vacation)

	P.S. My english is not good enough. :-)

	Thank you.

Cheers,

Freitas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: probs4.txt
Type: application/octet-stream
Size: 4235 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040726/8c902c84/probs4.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: results_jean.txt
Type: application/octet-stream
Size: 4483 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040726/8c902c84/results_jean.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: results_jean_dump.txt
Type: application/octet-stream
Size: 725 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040726/8c902c84/results_jean_dump.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (7 preceding siblings ...)
  2005-05-19  6:25 ` Ivars Strazdins
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> I finally got hands on that system, which appeared to be D815EEA, not 
> D815EEA2

I don't think this makes much difference, does it?

> It has only one fan (CPU) connected to fan3. Fan1 and fan2 are not 
> connected (according to labels on motherboard). however, fan3 is
> 3-wire. I do not know what else I could test as testing fan1 and fan2
> imo makes no sense.

Labels on the motherboad do not necessarily match those of the SMSC chip
(which is what lm_sensors use), but the 0 readings suggest that fans 1
and 2 on one side are 1 and 2 on the other side (exact matching
unknown), i.e. fan 3 (as labeled on your motherboard) is not monitored,
and most probably not controlable either.

If you have a spare 3-wire fan, you can just plug it into either fan 1
or 2 (as labeled on your motherboard) and see what happens. If not,
well, I guess that your testing is over.

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (11 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` cgfreita
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> Please, take a look at probs4.txt attached.

The good point is that you seem to be able to control fan 1's speed. But
the reported value goes weird as soon as the fan is stopped. Either the
value isn't updated anymore (i.e. last value is reported) or random
values are reported. Since it reported 5851 RPM once, which doesn't seem
possibe, I would opt for the second case. However, I would like you to
do some more tests to confirm that.

Please stop the fan (pwm_enable=1, pwm=0) and run sensors several times
in a row, with some delay between each run. Check if the (obviously
wrong value) which is reported is the same each time, or not.

> Please, take a look at results_jean.txt

My code was obviously bogus, fan min was not preserved at all when
changining fan div. I just took a look and have to say I'm a bit
ashamed, since it was caused by... a misplaced parenthesis.

Fixed patch is available:
http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta3.diff
if you can please test again using the same script. Oh, BTW:

> modprobe i2c_sensor
> modprobe i2c-i801
> modprobe i2c-isa
> modprobe adm1025
> modprobe smsc47m1

You don't need to explicitly modprobe i2c_sensor, it'll be loaded as
needed automatically.

> and results_jean_dump.txt.

Fan alarms are not set on the dump you sent, so there's nothing I can
check. The case I'm interested in is when "sensors" show an alarm which
you think should not be there. If you provide both the output of
"sensors" and the dump at that instant, I may be able to check if
sensors' output matches the registers dump or not. If you are not able
to reproduce that corner case or are not worried about it, just forget
about it, it's not critical.

> From today, I can delay a little more to answer because I am back to
> college classes. (The end of vacation)

Oh, I wish you well then :)

> P.S. My english is not good enough. :-)

Like mine is perfect? ;) Come on, you must be kidding, your English is
honest to say the least. You have no idea what bad English is.

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (8 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` cgfreita
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> BTW, I think that there's still something broken in the 2.4 smsc47m1
> driver. If I read the datasheets correctly, pwm_enable currently does
> what you tell it not to do, ie: 1 will force fan to full speed while 0
> will enable PWM.

I did the change, hope it was correct.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (6 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Ivars Strazdins
  2005-05-19  6:25 ` Jean Delvare
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Ivars Strazdins @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

the cup fan wire is way too short to connect to either fan1 or 2 :(
well, my testing wasn't too useful
anyway, i appreciate your great work. for me this motherboard reports 
temperatures now
with best regards,
Ivars

Jean Delvare wrote:

>>I finally got hands on that system, which appeared to be D815EEA, not 
>>D815EEA2
>>    
>>
>
>I don't think this makes much difference, does it?
>
>  
>
>>It has only one fan (CPU) connected to fan3. Fan1 and fan2 are not 
>>connected (according to labels on motherboard). however, fan3 is
>>3-wire. I do not know what else I could test as testing fan1 and fan2
>>imo makes no sense.
>>    
>>
>
>Labels on the motherboad do not necessarily match those of the SMSC chip
>(which is what lm_sensors use), but the 0 readings suggest that fans 1
>and 2 on one side are 1 and 2 on the other side (exact matching
>unknown), i.e. fan 3 (as labeled on your motherboard) is not monitored,
>and most probably not controlable either.
>
>If you have a spare 3-wire fan, you can just plug it into either fan 1
>or 2 (as labeled on your motherboard) and see what happens. If not,
>well, I guess that your testing is over.
>
>Thanks.
>
>  
>

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (10 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> the cup fan wire is way too short to connect to either fan1 or 2 :(
> well, my testing wasn't too useful
> anyway, i appreciate your great work. for me this motherboard reports 
> temperatures now
> with best regards,
> Ivars

Well, your help was still better than nothing :)

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (12 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` Jean Delvare
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

Hi Jean,

	Uff, finally I ran the tests.
	As usually, I patched -R beta2.diff, patched -p1 beta3.diff and
make bzImage, make install, make modules, make modules_install.
	Everything was fine. No .rej.

> > Please, take a look at probs4.txt attached.
> 
> The good point is that you seem to be able to control fan 1's speed.
> But the reported value goes weird as soon as the fan is stopped.
> Either the value isn't updated anymore (i.e. last value is reported)
> or random values are reported. Since it reported 5851 RPM once,
> which doesn't seem possibe, I would opt for the second case.
> However, I would like you to do some more tests to confirm that.
> 
> Please stop the fan (pwm_enable=1, pwm=0) and run sensors several
> times in a row, with some delay between each run. Check if the
> (obviously wrong value) which is reported is the same each time, or
> not.
> 
> > Please, take a look at results_jean.txt
> 
> My code was obviously bogus, fan min was not preserved at all when
> changining fan div. I just took a look and have to say I'm a bit
> ashamed, since it was caused by... a misplaced parenthesis.
> 
> Fixed patch is available:
> http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-beta3.diff
> if you can please test again using the same script. Oh, BTW:
> 
> > modprobe i2c_sensor
> > modprobe i2c-i801
> > modprobe i2c-isa
> > modprobe adm1025
> > modprobe smsc47m1
> 
> You don't need to explicitly modprobe i2c_sensor, it'll be loaded as
> needed automatically.

	Forgive me for the giant quote.
	You can see at j1 (jean.tar.bz2) directory, the results you asked
for. Please take a look.

> > and results_jean_dump.txt.
> 
> Fan alarms are not set on the dump you sent, so there's nothing I
> can check. The case I'm interested in is when "sensors" show an
> alarm which you think should not be there. If you provide both the
> output of"sensors" and the dump at that instant, I may be able to
> check if sensors' output matches the registers dump or not. If you
> are not able to reproduce that corner case or are not worried about
> it, just forget about it, it's not critical.

	Please, take a look at j2 (jean.tar.bz2) directory. There are the
tests you asked for. Oh, check if the .sh is ok to you.
	I don't matter about the ALARMS. I just tried to give you
the more information I could.

> > From today, I can delay a little more to answer because I am back
> > to college classes. (The end of vacation)
> 
> Oh, I wish you well then :)

	So do I. Thank you. :-)
 
> > P.S. My english is not good enough. :-)
> 
> Like mine is perfect? ;) Come on, you must be kidding, your English
> is honest to say the least. You have no idea what bad English is.

	Well, if you are understanding what I write, it is fine. :-)
	Please, if you need more information, tell me.
	I was wondering, are there some other things that can influence the
behaviour of sensors? I mean, that could be affecting the results?
	Thanks.

Freitas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean.tar.bz2
Type: application/octet-stream
Size: 2275 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040803/45e281c7/jean.tar.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (13 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` cgfreita
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> You can see at j1 (jean.tar.bz2) directory, the results you
> asked for. Please take a look.

Makes me think that fan speed stops being monitored when PWM is enabled
and have value (duty cycle) 0. I would call it a design flaw since it
will make the driver code more complex and becomes bogus if the fan
being monitored and the fan being controled are not the same one (which
is the case with somt revisions of that Intel board, it seems).

Nevermind, we'll have to handle this. Could you please try the following
test to confirm my point?

echo 1 > fan2_pwm_enable
for i in 252 236 220 204 188 172 156 140 124 108 92 76 60 44 28 12 0
do
	echo $i > fan2_pwm
	sleep 4
	cat fan2_input
done

I think I will have to force the fan reading to 0 when PWM is enabled
and PWM value is 0, regardless of what the register holds.

> Please, take a look at j2 (jean.tar.bz2) directory. There are
> the tests you asked for. Oh, check if the .sh is ok to you.
> I don't matter about the ALARMS. I just tried to give you
> the more information I could.

That one looks fine, min limit is preserved as it should :)

> I was wondering, are there some other things that can influence
> the behaviour of sensors? I mean, that could be affecting the
> results?

Well, ambient temperature obviously affects the temperature readings.
The heavy use of specific devices (such as the graphics adapter) may
have an impact on voltage readings. For the rest, it shouldn't change
unless you explicitely ask for it (changing PWM values, changing the CPU
speed, etc...)

Thanks.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (15 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

WARNING: This e-mail has been altered by MIMEDefang.  Following this
paragraph are indications of the actual changes made.  For more
information about your site's MIMEDefang policy, contact
andrew.net.au Postmaster <postmaster@andrew.net.au>.  For more information about MIMEDefang, see:

            http://www.roaringpenguin.com/mimedefang/enduser.php3

An attachment named jean_1.sh was removed from this document as it
constituted a security hazard.  If you require this document, please contact
the sender and arrange an alternate means of receiving it.

-------------- next part --------------
> > You can see at j1 (jean.tar.bz2) directory, the results you
> > asked for. Please take a look.
> 
> Makes me think that fan speed stops being monitored when PWM is
> enabled and have value (duty cycle) 0. I would call it a design flaw
> since it will make the driver code more complex and becomes bogus if
> the fan being monitored and the fan being controled are not the same
> one (which is the case with somt revisions of that Intel board, it
> seems).
> 
> Nevermind, we'll have to handle this. Could you please try the
> following test to confirm my point?
> 
> echo 1 > fan2_pwm_enable
> for i in 252 236 220 204 188 172 156 140 124 108 92 76 60 44 28 12 0
> do
> 	echo $i > fan2_pwm
> 	sleep 4
> 	cat fan2_input
> done
> 
> I think I will have to force the fan reading to 0 when PWM is
> enabled and PWM value is 0, regardless of what the register holds.

	The results are attached, including the shell script I used.
	I sent you the results for fan2, as you asked, and for fan1, because
fan2 here appears to be the CPU cooler. Anyway, using fan1 the
corresponding fan was stopped at the end of the script. :-)

> > Please, take a look at j2 (jean.tar.bz2) directory. There are
> > the tests you asked for. Oh, check if the .sh is ok to you.
> > I don't matter about the ALARMS. I just tried to give you
> > the more information I could.
> 
> That one looks fine, min limit is preserved as it should :)

	It is a good thing. :-)

> > I was wondering, are there some other things that can influence
> > the behaviour of sensors? I mean, that could be affecting the
> > results?
> 
> Well, ambient temperature obviously affects the temperature
> readings. The heavy use of specific devices (such as the graphics
> adapter) may have an impact on voltage readings. For the rest, it
> shouldn't change unless you explicitely ask for it (changing PWM
> values, changing the CPU speed, etc...)

	Ok. I was just wondering if some strange values could be the result
of some interference.
	When you need more information, please, tell me. :-)

	Thanks.

Freitas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean_results_for_fan1.txt
Type: application/octet-stream
Size: 58 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040804/8071008b/jean_results_for_fan1.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean_results_for_fan2.txt
Type: application/octet-stream
Size: 85 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040804/8071008b/jean_results_for_fan2.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (16 preceding siblings ...)
  2005-05-19  6:25 ` cgfreita
@ 2005-05-19  6:25 ` Jean Delvare
  2005-05-19  6:25 ` Jean Delvare
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

> The results are attached, including the shell script I used.
> I sent you the results for fan2, as you asked, and for fan1,
> because fan2 here appears to be the CPU cooler. Anyway, using
> fan1 the corresponding fan was stopped at the end of the script.
> :-)

OK, so it must be working. I should have told you to set the fan clock
divider to 8 before starting the test, but the results are still
significant.

I've updated the driver:
http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-rc1.diff

It should now force the fan speed reading to 0 when PWM is enabled with
a duty cycle of 0%. So for example the following sequence should work
fine:

echo 0 > fan1_pwm_enable
echo 0 > fan1_pwm
sleep 4
cat fan1_input (should return 3000 or so)
echo 1 > fan1_pwm_enable (fan should stop)
sleep 3
cat fan1_input (should return 0)

With the previous version if would have returned the last known speed or
some other random non-zero value (it seems) while the fan would clearly
be stopped.

If you confirm that this version of the driver works fine for you, I'll
submit it for incorporation into Greg's tree.

> Ok. I was just wondering if some strange values could be the
> result of some interference.

Unless you refer to interference in the designers brains, I don't think
so ;)

Thanks a lot for testing, it looks like we finally came to a working 2.6
driver.

-- 
Jean "Khali" Delvare
http://khali.linux-fr.org/

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (14 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` cgfreita
  2005-05-19  6:25 ` cgfreita
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 20+ messages in thread
From: cgfreita @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors

WARNING: This e-mail has been altered by MIMEDefang.  Following this
paragraph are indications of the actual changes made.  For more
information about your site's MIMEDefang policy, contact
andrew.net.au Postmaster <postmaster@andrew.net.au>.  For more information about MIMEDefang, see:

            http://www.roaringpenguin.com/mimedefang/enduser.php3

An attachment named jean.sh was removed from this document as it
constituted a security hazard.  If you require this document, please contact
the sender and arrange an alternate means of receiving it.


An attachment named jean_1.sh was removed from this document as it
constituted a security hazard.  If you require this document, please contact
the sender and arrange an alternate means of receiving it.


An attachment named woops.sh was removed from this document as it
constituted a security hazard.  If you require this document, please contact
the sender and arrange an alternate means of receiving it.

-------------- next part --------------
Jean,

> > The results are attached, including the shell script I used.
> > I sent you the results for fan2, as you asked, and for fan1,
> > because fan2 here appears to be the CPU cooler. Anyway, using
> > fan1 the corresponding fan was stopped at the end of the script.
> > :-)
> 
> OK, so it must be working. I should have told you to set the fan
> clock divider to 8 before starting the test, but the results are
> still significant.
> 
> I've updated the driver:
> http://khali.linux-fr.org/devel/i2c/linux-2.6/linux-2.6.8-rc2-i2c-smsc47m1-rc1.diff
> 
> It should now force the fan speed reading to 0 when PWM is enabled
> with a duty cycle of 0%. So for example the following sequence
> should work fine:
> 
> echo 0 > fan1_pwm_enable
> echo 0 > fan1_pwm
> sleep 4
> cat fan1_input (should return 3000 or so)
> echo 1 > fan1_pwm_enable (fan should stop)
> sleep 3
> cat fan1_input (should return 0)
> 
> With the previous version if would have returned the last known
> speed or some other random non-zero value (it seems) while the fan
> would clearly be stopped.

	patch -R -p1 beta3.diff
	patch -p1 < rc1.diff
	Worked. Compiled fine.
	The tests above worked, as you can see at attached file (*rc1.txt).

	Just for curiosity I tried to use 90 as fan1_pwm value. I opened the
case to confirm if fan was still running.
	As you will see at *woops.txt (result of woops.sh), I found a
strange behaviour. I don't know if it is important, but I thought you
should know.
	I made another test (attached) trying to help.

> If you confirm that this version of the driver works fine for you,
> I'll submit it for incorporation into Greg's tree.

	I am trying to give you the best information I can, to help as much
as I can, but I am worried about disturbing you a lot.
	I mean, I have never helped testing software like this, so I am
always thinking if I am being a problem more than a helper. :-)

> > Ok. I was just wondering if some strange values could be the
> > result of some interference.
> 
> Unless you refer to interference in the designers brains, I don't
> think so ;)

	Hahahahahahahahaha. :-D
 
> Thanks a lot for testing, it looks like we finally came to a working
> 2.6 driver.

	It is working here. My gkrellm is always showing my fans and voltages
(just vid does not appear there, but it doesn't matter). I am happy.
	I noticed the behaviour above, but I don't know if it is important.
And, anyway, I can turn off my fan. :-)
	As I say, I want to help, but I don't want to disturb you or became a
problem. When you fell it is ready, so it is ready. :-)
	If you need more information, just tell me.
	Thank you for coding the driver.

Cheers,

Cassio Freitas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean_is_running.txt
Type: application/octet-stream
Size: 24652 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040805/29ef13f4/jean_is_running.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean_results_rc1.txt
Type: application/octet-stream
Size: 7 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040805/29ef13f4/jean_results_rc1.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jean_results_woops.txt
Type: application/octet-stream
Size: 4548 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040805/29ef13f4/jean_results_woops.obj

^ permalink raw reply	[flat|nested] 20+ messages in thread

* smsc47m1 ported to Linux 2.6
  2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
                   ` (17 preceding siblings ...)
  2005-05-19  6:25 ` Jean Delvare
@ 2005-05-19  6:25 ` Jean Delvare
  18 siblings, 0 replies; 20+ messages in thread
From: Jean Delvare @ 2005-05-19  6:25 UTC (permalink / raw)
  To: lm-sensors


>Just for curiosity I tried to use 90 as fan1_pwm value. I opened the
>case to confirm if fan was still running.
>As you will see at *woops.txt (result of woops.sh), I found a
>strange behaviour. I don't know if it is important, but I thought you
>should know.
>I made another test (attached) trying to help.

I think that you refer to the fact that sometimes the driver will report
0 RPM while you can still see the fan (slowly) spin. This is a hardware
design limitation, common to almost all hardware monitoring chipsets.
This is not a problem in this specific driver.

Fan speeds are not measured directly. Instead, the chipsets will count
how many cycles of a given clock can fit between two turns (or,
partically, two half turns) of the fan. The result is stored in a
register and some maths are needed to get the RPM value.

The problem here is that the registers are almost alwats 8-bit wide. This
means that the greater count that can fit is 255. As a result, if the
chipset uses for example a 1 MHz clock and the fan emits to
ticks/revolution (standard), the lowest speed you can measure is
1000000/(2*255) = 1960 RPM

To allow for slower fan monitoring, chipsets can usually divide the
source clock by 2, 4, 8 or even more. With a divider of 8, the lowest
speed you can measure would be 1000000/(8*2*255) = 245 RPM which is far
better. The drawback is that you then lose resolution on higher speeds,
which is why the highest dividers are usually not used by default.

So you can try increasing the divider to 8 and should be able to monitor
much slower fans.

The SMSC chips have the particularity that the fan min also influences
the lowest measurable fan speed (for other chips, only the divider
matters) so things are even more complex. For a clock of 983040*2 Hz,
divider of 8, you should be able to specify the min speed down to 640
RPM. If you do, the lowest fan speed you will be able to measure is 483
RPM. Below this, the driver will return 0. If you set the min speed to
1000 RPM, the lowest fan speed you will be able to measure is 702 RPM.

You may read the SMSC LPC47M14x datasheet for calculation details if you
are interested.

I plan to modifiy the driver at a later time so that it can select the
best divider automatically. That way, the end user won't have to know
anything about the internals. But for now I prefer to have the driver
merged into the main tree. Improvements can be added later.

>I am trying to give you the best information I can, to help as much
>as I can, but I am worried about disturbing you a lot.
>I mean, I have never helped testing software like this, so I am
>always thinking if I am being a problem more than a helper. :-)

You do very well. I consider the testing over and will send the patch to
Greg as soon as I am back home.

>Thank you for coding the driver.

Thanks again for testing :)

Jean Delvare

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2005-05-19  6:25 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19  6:25 smsc47m1 ported to Linux 2.6 Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Ivars Strazdins
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` cgfreita
2005-05-19  6:25 ` Jean Delvare
2005-05-19  6:25 ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.