Skip to contentSkip to conversation

New LM83 driver

DISCUSSION Jean Delvare 2 participants 15 messages May 19, 2005

lore
Share & tools
lore
#0 lore raw

High Magnus,

I commited my changes to the lm83 driver to CVS. It adds support for T_CRIT (Critical temperature, common to all four temperature sensors) and gives access to the two status registers (alarm flags and diode fault detection). Could you please give it a try? I'd like to know if it works as intended.

Note that you'll need i2c-CVS in order to use lm_sensors2-CVS.

Thanks!

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#1 lore raw

Hello!
I only downloaded the lm83.c file and recompiled it. How do I see/test the status register? I was expecting something from the sensors output.

The sensors output was:

Adapter: SMBus PIIX4 adapter at 0580
Algorithm: Non-I2C SMBus adapter
temp1:       +36°C  (limit = +100°C)                      
temp2:       +39°C  (limit = +100°C)                      
temp3:       +50°C  (limit = +100°C)                      
temp4:       +42°C  (limit = +100°C)        

In the proc filesystem Ive got:

# ls /proc/sys/dev/sensors/lm83-i2c-0-19/
alarms  tcrit   temp1   temp2   temp3   temp4   
# cat /proc/sys/dev/sensors/lm83-i2c-0-19/tcrit
120
# cat /proc/sys/dev/sensors/lm83-i2c-0-19/alarms 
0

Regards
Magnus Forsström

#2 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#3 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#4 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#5 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#6 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#7 lore raw
In reply to Jean Delvare

Hello!
Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36°C  (limit = +100°C, critical = +120°C)   
temp2:       +35°C  (limit = +100°C, critical = +120°C)   
temp3:       +42°C  (limit = +100°C, critical = +120°C)   
temp4:       +44°C  (limit = +100°C, critical = +120°C)   

I tried the IP address but it timed out, so I still think the firewall blocks the port or protocol CVS uses.

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

/Magnus Forsström

#8 lore raw
In reply to Jean Delvare
Quoted 4 lines

I only downloaded the lm83.c file and recompiled it. How do I see/test the status register? I was expecting something from the sensors output.

You need to check a fresh CVS out in order to see the changes, because not only the driver, but also the library and userspace tools, have changed. Also note that you'll need i2c-CVS too.

Quoted 8 lines

The sensors output was:

Adapter: SMBus PIIX4 adapter at 0580
Algorithm: Non-I2C SMBus adapter
temp1:       +36?C  (limit = +100?C)                      
temp2:       +39?C  (limit = +100?C)                      
temp3:       +50?C  (limit = +100?C)                      
temp4:       +42?C  (limit = +100?C)        
Quoted 8 lines

In the proc filesystem Ive got:

# ls /proc/sys/dev/sensors/lm83-i2c-0-19/
alarms  tcrit   temp1   temp2   temp3   temp4   
# cat /proc/sys/dev/sensors/lm83-i2c-0-19/tcrit
120
# cat /proc/sys/dev/sensors/lm83-i2c-0-19/alarms 
0

So far so good, let's see if the library and userspace tools code is ok too.

Oh, another thing. I'm still wondering which elements of your PC the temperatures shown here can correspond to. Temp1 is the LM83's own temperature. We guessed that temp3 had to be the CPU's one. We have temp2 and temp4 left. The datasheets gives a Battery and a LCD as examples, but I don't think you have such devices on your system, do you? So I still believe the North and South bridges are good candidates.

Could you remind me what the brand and model of your motherboard are? Maybe I could take a look at the online docs and see if I can learn something there. And anyway, I'd like to mention the motherboard's model in our docs as "known to have a LM83 on it".

Thanks a lot!

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#9 lore raw
In reply to Jean Delvare
Quoted 3 lines

I had a quick look at the documentation before and it seemed like two of the D? input pins were wired together.

This is something possible (documented in the LM83 datasheet, makes it possible to set multiple HIGH setpoints for a single measurement). However...

Quoted 2 lines

But that doesn't make sense
since no two temperatures are always the same.

Exactly, this is obviously not the case here.

Quoted 3 lines

I think one went to the south bridge. And maybe I have a north bridge as well!
I'll have a closer look at the docs tomorrow.

No doubt you have a South bridge, all recent computers do have one AFAIK.

Now that we have a driver working, an interesting test could be to monitor these unknown temperatures and see if a given action (listening to music, watching a video, heavy network traffic...) has a significant impact on each of them. This would help us discover which chips the temperatures belong to. BTW, do that only if you have some spare time, this is more my curiousity speaking here. We don't really need to know that.

Quoted 1 line

The brand is SBS and the model is called P014.

Never heard about that brand. The website seems to be:
http://www.sbs.com/
But I can't see any product called "P014" there, and Goggl'ing it didn't help either.

Would you have a possibility to compile and run dmidecode on the machine?
http://www.nongnu.org/dmidecode/

Thanks.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#10 lore raw
In reply to Jean Delvare

(Message received 12 times, what happened?)

Quoted 1 line

Thanks Jean I grabbed your CVS snapshot and compiled it. Worked fine!

Great.

Quoted 6 lines
# prog/sensors/sensors -A lm83-i2c-0-19
lm83-i2c-0-19
temp1:       +36?C  (limit = +100?C, critical = +120?C)   
temp2:       +35?C  (limit = +100?C, critical = +120?C)   
temp3:       +42?C  (limit = +100?C, critical = +120?C)   
temp4:       +44?C  (limit = +100?C, critical = +120?C)   

Could you try setting some limits (through the config file or manually, using "echo 110 > /proc/sys/dev/sensors/lm83-i2c-0-19/tcrit" for example)? I'd like to know if changing limits works OK. Also, please try setting limits (both high and critical) below the actual readings. It should trigger various alarms, that show in the alarms file, and when running sensors too (even more readable).

WARNING: according to the LM83 datasheet, a critical alarm could result in a system shutdown. It's not as explicitely said for high limits, but there could be some hardware triggering there too (I'd simply expect beeping and/or fans starting or speeding up). Playing with high limits is probably less dangerous than playing with tcrit. Anyway, if you can't take the risk, don't try setting limits to stupid values. I can't guess how your motherboard is wired.

If you still want to help, there is a safe way to do the tests. The possible effects of alarms can be disabled. The driver doesn't allow that yet (not sure it should anyway) but there's another way.

1* Disable the alarms effects:
i2cset 0 0x19 0x09 0xbc b

2* Play with limits and see how sensors react.

3* Reset limits to correct values.

4* Enable the alarms effects again:
i2cset 0 0x19 0x09 0x00 b

I think this solution is safe. However, if you don't feel like playing with fire, just don't.

Quoted 16 lines

Here is the output from dmidecode:

# dmidecode   
# dmidecode 1.8
BIOS32 Service Directory present.
        Calling Interface Address: 0x000F0010
PCI Interrupt Routing 1.0 present.
        Table Size: 288 bytes
        Router ID: 00:0f.0
        Exclusive IRQs: None
        Compatible Router: 1166:0201
PNP 1.0 present.
        Event Notification: Not Supported
        Real Mode Code Address: F000:4932
        Real Mode Data Address: F000:0000
        Protected Mode Code Address: 0x000F495A
        Protected Mode Data Address: 0x000F0000

Old version of dmidecode. No DMI table anyway, so it doesn't really matter. We won't learn about this motherboard that way.

Thanks!

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#11 lore raw
In reply to Jean Delvare
Quoted 2 lines

(Message received 12 times, what happened?)

Nothing happened when I pressed the send button. But it seems like something did happen...

Quoted 2 lines

Could you try setting some limits (through the config file or manually,

Tried setting both critical and high. When temp was over high I got:
temp1: +38°C (limit = +47°C, critical = +60°C) ALARM

I had a look at the wiring diagram and all D+ ports are wired together. But as said before the temperatures differ with as much as 7 degrees within a single reading I find that hard to believe.

Magnus

#12 lore raw
In reply to Jean Delvare
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

Could you try setting some limits (through the config file or manually,

Tried setting both critical and high. When temp was over high I got:
temp1: +38°C (limit = +47°C, critical = +60°C) ALARM

I don't understand. In this example, 38 < 47 and 38 < 60 so no alarm should trigger at all - yet the high alarm seems to be set. Looks like a bug in my driver :(

No the temperature has been over the high limit since the last reading. I temporarily changed the limit to 40 and then back to 47. Since the temperature is not constant an alarm has been generated.

Quoted 6 lines
Quoted 4 lines

I had a look at the wiring diagram and all D+ ports are wired together. But as said before the temperatures differ with as much as 7 degrees within a single reading I find that hard to believe.

Sure, I just can't believe it. BTW, where did you got that diagram?

It comes from the manufacturer. I assume that we have made a special request that they should supply us with a wiring diagram.

/Magnus

#13 lore raw
In reply to Jean Delvare
Quoted 4 lines
Quoted 2 lines

(Message received 12 times, what happened?)

Nothing happened when I pressed the send button. But it seems like something did happen...

OK, no problem. Just wanted to make sure it wasn't a mailing-list issue.

Quoted 4 lines
Quoted 2 lines

Could you try setting some limits (through the config file or manually,

Tried setting both critical and high. When temp was over high I got:
temp1: +38?C (limit = +47?C, critical = +60?C) ALARM

I don't understand. In this example, 38 < 47 and 38 < 60 so no alarm should trigger at all - yet the high alarm seems to be set. Looks like a bug in my driver :(

Quoted 3 lines

I had a look at the wiring diagram and all D+ ports are wired together. But as said before the temperatures differ with as much as 7 degrees within a single reading I find that hard to believe.

Sure, I just can't believe it. BTW, where did you got that diagram? I know no motherboard manufacturer that give a full wiring diagram for their motherboard (and I don't blame them, most people just wouldn't care).

Thanks for testing :)

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
#14 lore raw
In reply to Jean Delvare
Quoted 8 lines
Quoted 4 lines

I don't understand. In this example, 38 < 47 and 38 < 60 so no alarm should trigger at all - yet the high alarm seems to be set. Looks like a bug in my driver :(

No the temperature has been over the high limit since the last reading. I temporarily changed the limit to 40 and then back to 47. Since the temperature is not constant an alarm has been generated.

OK, this makes sense then. The alarm bits are not cleared until the status register is read, so that you'll never miss an alarm, even if you were not reading the temperatures at the time the alarm triggered. So you will still see the alarm flag once (and for the two following seconds, due to internal caching) after the alarm condition has disappeared. This is a feature, not a bug.

Same applies to T_CRIT of course.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

I had a look at the wiring diagram and all D+ ports are wired together. But as said before the temperatures differ with as much as 7 degrees within a single reading I find that hard to believe.

Sure, I just can't believe it. BTW, where did you got that diagram?

It comes from the manufacturer. I assume that we have made a special request that they should supply us with a wiring diagram.

Well, maybe the request should have mentioned the fact that you wanted a *real* diagram, matching the hardware ;) Obviouslsy it isn't the case here, at least as far as hardware monitoring is concerned.

Magnus, thanks a lot for testing my driver. I appreciate that really much :)

Since it looks like the driver works OK, I'll update the configuration file and the docs, as well as the new drivers page. I think we can say the driver was tested and is known to work.

If you ever notice a problem with the driver, of just want to report about anything, let us know.

Thanks again.

Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/