Skip to contentSkip to conversation

adm1021 (probably) does something VERY,VERY BAD

DISCUSSION Applied Eric 4 participants 13 messages May 19, 2005

lore
Share & tools
lore

Eric

author
#0 lore raw

'greetings

Based on the output of sensors-detect I insmodded adm1021:

Driver `adm1021' (should be inserted):
Detects correctly:
* Bus SMBus I801 adapter at 0c00' (Algorithm unavailable) Busdriver i2c-i801', I2C address 0x4e
Chip `National Semiconductor LM84' (confidence: 5)

The module was build from a 2.6.5-rc1 kernel tree (SMP). After insmodding the
module the machine shut down instantly, which could have only been caused because the hardware detected _something_ critical enough that it shut down the
system immediatly. Initial tries to power up again were futile, only after unplugging
and giving it a few minutes the machine came back up again (*phew*).

I can't give you anything other helpfull information concerning what happened, simply
because there was none given. However I put the details of the machine below.
Whatever happened, it shouldn't have happened :-) (I'm just glad the machine came back
on again.)

let me know if you require any other information

Kind regards,

Eric

/proc/cpuinfo

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 9
cpu MHz : 2400.153
cache size : 512 KB
physical id : 0
siblings : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips : 4734.97

processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 2
model name : Intel(R) Pentium(R) 4 CPU 2.40GHz
stepping : 9
cpu MHz : 2400.153
cache size : 512 KB
physical id : 0
siblings : 2
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid
bogomips : 4784.12

root@pathfinder eric # sensors-detect

This program will help you determine which I2C/SMBus modules you need to load to use lm_sensors most effectively. You need to have i2c and lm_sensors installed before running this program.
Also, you need to be `root', or at least have access to the /dev/i2c-* files, for most things.
If you have patched your kernel and have some drivers built in, you can safely answer NO if asked to load some modules. In this case, things may seem a bit confusing, but they will still work.

We can start with probing for (PCI) I2C or SMBus adapters. You do not need any special privileges for this. Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 00:1f.3: Intel 82801EB ICH5 Probe succesfully concluded.

We will now try to load each adapter module in turn.
Load `i2c-i801' (say NO if built into your kernel)? (YES/no): no
Do you now want to be prompted for non-detectable adapters? (yes/NO):
To continue, we need module `i2c-dev' to be loaded.
If it is built-in into your kernel, you can safely skip this. i2c-dev is not loaded. Do you want to load it now? (YES/no): no Well, you will know best. We will just hope you edited `/etc/modules.conf' for automatic loading of this module. If not,
you won't be able to open any /dev/i2c-* file (unless youhave it built-in into your kernel)

We are now going to do the adapter probings. Some adapters may hang halfway through; we can't really help that. Also, some chips will be double
detected;
we choose the one with the highest confidence value in that case. If you found that the adapter hung after probing a certain address, you can specify that address to remain unprobed. That often
includes address 0x69 (clock chip).

Next adapter: SMBus I801 adapter at 0c00 (Algorithm unavailable) Do you want to scan it? (YES/no/selectively):
Client found at address 0x08
Client found at address 0x2f
Probing for National Semiconductor LM78'... Failed! Probing for National Semiconductor LM78-J'... Failed! Probing for National Semiconductor LM79'... Failed! Probing for National Semiconductor LM80'... Failed! Probing for `Winbond W83781D'... Failed!
Probing for `Winbond W83782D'... Failed!
Probing for `Winbond W83791D'... Failed!
Probing for `Winbond W83627HF'... Failed!
Probing for `Asus AS99127F (rev.1)'... Failed!
Probing for `Asus AS99127F (rev.2)'... Failed!
Probing for `Asus ASB100 Bach'... Failed!
Probing for Analog Devices ADM9240'... Failed! Probing for Dallas Semiconductor DS1780'... Failed! Probing for National Semiconductor LM81'... Failed! Probing for Analog Devices ADM1029'... Failed! Probing for Analog Devices ADM1022'... Failed! Probing for Texas Instruments THMC50'... Failed! Probing for `ITE IT8705F / IT8712F / SiS 950'... Failed! Client found at address 0x44
Client found at address 0x4e
Probing for National Semiconductor LM75'... Failed! Probing for Dallas Semiconductor DS1621'... Failed! Probing for Analog Devices ADM1021'... Failed! Probing for Analog Devices ADM1021A/ADM1023'... Failed! Probing for `Maxim MAX1617'... Success!

    (confidence 3, driver `adm1021')
Probing for `Maxim MAX1617A'... Failed!
Probing for `TI THMC10'... Failed!
Probing for `National Semiconductor LM84'... Success!
    (confidence 5, driver `adm1021')

Probing for `Genesys Logic GL523SM'... Failed!
Probing for `Onsemi MC1066'... Failed!
Probing for `National Semiconductor LM82'... Failed!
Probing for `National Semiconductor LM83'... Failed!
Client at address 0x50 can not be probed - unload all client drivers first! Client at address 0x52 can not be probed - unload all client drivers first! Client found at address 0x69

Some chips are also accessible through the ISA bus. ISA probes are typically a bit more dangerous, as we have to write to I/O ports to do this. Do you want to scan the ISA bus? (YES/no):
Probing for `National Semiconductor LM78'
Trying address 0x0290... Failed!
Probing for `National Semiconductor LM78-J'
Trying address 0x0290... Failed!
Probing for `National Semiconductor LM79'
Trying address 0x0290... Failed!
Probing for `Winbond W83781D'
Trying address 0x0290... Failed!
Probing for `Winbond W83782D'
Trying address 0x0290... Failed!
Probing for `Winbond W83627HF'
Trying address 0x0290... Success!

    (confidence 8, driver `w83781d')

Probing for `Winbond W83697HF'
Trying address 0x0290... Failed!
Probing for `Silicon Integrated Systems SIS5595'
Trying general detect... Failed!
Probing for `VIA Technologies VT82C686 Integrated Sensors'
Trying general detect... Failed!
Probing for `VIA Technologies VT8231 Integrated Sensors'
Trying general detect... Failed!
Probing for `ITE IT8705F / IT8712F / SiS 950'
Trying address 0x0290... Failed!
Probing for `IPMI BMC KCS'
Trying address 0x0ca0... Failed!
Probing for `IPMI BMC SMIC'
Trying address 0x0ca8... Failed!

Some Super I/O chips may also contain sensors. Super I/O probes are typically a bit more dangerous, as we have to write to I/O ports to do this. Do you want to scan for Super I/O sensors? (YES/no):
Probing for `ITE 8702F Super IO Sensors'
Failed! (0x5217)
Probing for `ITE 8705F Super IO Sensors'
Failed! (0x5217)
Probing for `ITE 8712F Super IO Sensors'
Failed! (0x5217)
Probing for `Nat. Semi. PC87351 Super IO Fan Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87360 Super IO Fan Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87363 Super IO Fan Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87364 Super IO Fan Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87365 Super IO Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87366 Super IO Sensors'
Failed! (0x52)
Probing for `Nat. Semi. PC87372 Super IO Fan Sensors'
Failed! (0x52)
Probing for `SMSC 47B27x Super IO Fan Sensors'
Failed! (0x52)
Probing for `SMSC 47M10x/13x Super IO Fan Sensors'
Failed! (0x52)
Probing for `SMSC 47M14x Super IO Fan Sensors'
Failed! (0x52)
Probing for `SMSC 47M15x/192 Super IO Fan Sensors'
Failed! (0x52)
Probing for `VT1211 Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83627HF Super IO Sensors'
Success... found at address 0x0290
Probing for `Winbond W83627THF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83637HF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83697HF Super IO Sensors'
Failed! (0x52)
Probing for `Winbond W83697UF Super IO PWM'
Failed! (0x52)

Now follows a summary of the probes I have just done. Just press ENTER to continue:

Driver `adm1021' (should be inserted):
Detects correctly:
* Bus SMBus I801 adapter at 0c00' (Algorithm unavailable) Busdriver i2c-i801', I2C address 0x4e
Chip `National Semiconductor LM84' (confidence: 5)

Driver `w83781d' (may not be inserted):
Misdetects:
* ISA bus address 0x0290 (Busdriver `i2c-isa')

    Chip `Winbond W83627HF' (confidence: 8)

Driver `w83627hf' (should be inserted):
Detects correctly:
* ISA bus address 0x0290 (Busdriver i2c-isa') Chip Winbond W83627HF Super IO Sensors' (confidence: 9)

I will now generate the commands needed to load the I2C modules. Sometimes, a chip is available both through the ISA bus and an I2C bus. ISA bus access is faster, but you need to load an additional driver module for it. If you have the choice, do you want to use the ISA bus or the I2C/SMBus (ISA/smbus)?

If you want to load the modules at startup, generate a config file below and make sure lm_sensors get started (eg. rc-update add lm_sensors default).

To make the sensor modules behave correctly, add these lines to /etc/modules.conf:

#----cut here----
# I2C module options
alias char-major-89 i2c-dev
#----end cut here----

WARNING! If you have some things built into your kernel, the list above will contain too many modules. Skip the appropriate ones! You really should try these commands right now to make sure everything is working properly. Monitoring programs won't work until it's done.
To load everything that is needed, execute the commands above...

#----cut here----
# I2C adapter drivers
modprobe i2c-i801
modprobe i2c-isa
# I2C chip drivers
modprobe adm1021
modprobe w83627hf

# sleep 2 # optional
/usr/local/bin/sensors -s # recommended
#----end cut here----

Do you want to overwrite /etc/conf.d/lm_sensors? Enter s to specify other file name?
(yes/NO/s): no

#1 lore raw

[Please reply to the list, not to me]

Quoting Eric <[email protected]>:

Quoted 8 lines

Based on the output of sensors-detect I insmodded adm1021:

Driver `adm1021' (should be inserted):
Detects correctly:
* Bus SMBus I801 adapter at 0c00' (Algorithm unavailable) Busdriver i2c-i801', I2C address 0x4e
Chip `National Semiconductor LM84' (confidence: 5)

Quoted 6 lines

The module was build from a 2.6.5-rc1 kernel tree (SMP). After insmodding the module the machine shut down instantly, which could have only been caused because the hardware detected _something_ critical enough that it shut down the system immediatly. Initial tries to power up again were futile, only after unplugging and giving it a few minutes the machine came back up again (*phew*).

You're lucky it did come back. I think I remember we once had a report of such a case and the system never came back :(

Quoted 3 lines

I can't give you anything other helpfull information concerning what happened, simply because there was none given. However I put the details of the machine below.

I'd like the brand and model of the motherboard too.

Quoted 2 lines

Whatever happened, it shouldn't have happened :-) (I'm just glad the machine came back on again.)

I actually think that whatever you have at 0x4e, it isn't an adm1021 compatible chip. You already have a full featured monitoring chip on the board W83627HF, adding an old LM84 wouldn't make any sense.

That said, yes, we still should try to prevent what happened to you from happening to others. This could include:

1* Refine sensors-detect again. I thought it was OK after my latest changes, but obviously it isn't (providing this was sensors-detect from lm_sensors 2.8.5). One thing that would help would be to know what the mysterious chip is, and add detection for it in sensors-detect (even if it's not a hardware monitoring chip). Any idea of what this could be?

2* Refine adm1021's detection procedure too.

3* Drop adm1021's limit init. This was already done in the 2.4 driver and should have been done in 2.6 as well.

Quoted 1 line

let me know if you require any other information

I'd appreciate a dump of the faulty chip (i2cdump 0 0x2e), this could help us find out what it is and possibly prevent it from being recognized as an adm1021-compatible one.

Thanks and sorry for the trouble.

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

Quoting Eric <[email protected]>:

Quoted 2 lines

About the version I used, I couldn't find a version number in sensors-detect

We don't include any version in it because it would be a real pain to update it with each new release.

Quoted 2 lines

but I'm fairly sure this is 2.8.5 (from sensors --version) or better.

So you did the right thing, this was the right way to get the information :)

Quoted 1 line

root@pathfinder eric # i2cdump 0 0x2e

OK, I am too stupid. This was "i2cdump 0 0x4e", since the mysterious chip is as 0x04e.

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

Quoting Eric <[email protected]>:

Quoted 2 lines

root@pathfinder eric # i2cdump 0 0x4e
(...)

Great, at least we have a preliminary idea of what it does look like. I don't have an idea about what it can be though.

It would be interesting if you could try to dump it again from times to times, preferably with changing conditions (e.g. after a reboot, or under heavy CPU load) and see if any value change.

What I plan to do is use the constant parts of this dump to recognize this chip, whatever it is, and prevent sensors-detect from declaring it a MAX1617 or LM84 (the two easily misdetected chips of the ADM1021 family).

Thanks.

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

Quoting Eric <[email protected]>:

Quoted 2 lines

Well the main reason I figured wanted to use this chip was to know what was behind it :) Guess that was kinda stupid.

Well, sensors-detect told you to do it, you had no reason not to do it. I wouldn't have, because of the other well-known chip on the board, and because the detected chip was an LM84, which I know is rare, old and easily misdetected. But anyone not as familiar with the project as I am would have done the same as you I guess.

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

Hi Greg,

Quoting myself:

Quoted 2 lines

3* Drop adm1021's limit init. This was already done in the 2.4 driver and should have been done in 2.6 as well.

Here is a patch that does that. It also prevents bit 7 (and unused bits) of configuration register from being reset, as was discussed before:
http://archives.andrew.net.au/lm-sensors/msg04593.html
That second part needs to be backported to the 2.4 driver, and I will do so.

Additionally, we get rid of a useless label.

The patch is untested (I don't own any supported chip) but quite straightforward IMHO.

Please apply,
thanks.

drivers/i2c/chips/adm1021.c renamed from drivers/i2c/chips/adm1021.c.orig +3 -16
@@ -98,10 +98,6 @@
 they don't quite work like a thermostat the way the LM75 does.  I.e., 
 a lower temp than THYST actually triggers an alarm instead of 
 clearing it.  Weird, ey?   --Phil  */
-#define adm1021_INIT_TOS		60
-#define adm1021_INIT_THYST		20
-#define adm1021_INIT_REMOTE_TOS		60
-#define adm1021_INIT_REMOTE_THYST	20
 
 /* Each client has this additional data */
 struct adm1021_data {
@@ -306,7 +302,7 @@
 
 	/* Tell the I2C layer a new client has arrived */
 	if ((err = i2c_attach_client(new_client)))
-		goto error3;
+		goto error1;
 
 	/* Initialize the ADM1021 chip */
 	adm1021_init_client(new_client);
@@ -324,7 +320,6 @@
 
 	return 0;
 
-error3:
 error1:
 	kfree(new_client);
 error0:
@@ -333,17 +328,9 @@
 
 static void adm1021_init_client(struct i2c_client *client)
 {
-	/* Initialize the adm1021 chip */
-	adm1021_write_value(client, ADM1021_REG_TOS_W,
-			    adm1021_INIT_TOS);
-	adm1021_write_value(client, ADM1021_REG_THYST_W,
-			    adm1021_INIT_THYST);
-	adm1021_write_value(client, ADM1021_REG_REMOTE_TOS_W,
-			    adm1021_INIT_REMOTE_TOS);
-	adm1021_write_value(client, ADM1021_REG_REMOTE_THYST_W,
-			    adm1021_INIT_REMOTE_THYST);
 	/* Enable ADC and disable suspend mode */
-	adm1021_write_value(client, ADM1021_REG_CONFIG_W, 0);
+	adm1021_write_value(client, ADM1021_REG_CONFIG_W,
+		adm1021_read_value(client, ADM1021_REG_CONFIG_R) & 0xBF);
 	/* Set Conversion rate to 1/sec (this can be tinkered with) */
 	adm1021_write_value(client, ADM1021_REG_CONV_RATE_W, 0x04);
 }
Signature · 2 lines
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
Applied
#6 lore raw
In reply to Eric
Quoted 13 lines · Jean Delvare

Hi Greg,

Quoting myself:

Quoted 2 lines

3* Drop adm1021's limit init. This was already done in the 2.4 driver and should have been done in 2.6 as well.

Here is a patch that does that. It also prevents bit 7 (and unused bits) of configuration register from being reset, as was discussed before:
http://archives.andrew.net.au/lm-sensors/msg04593.html
That second part needs to be backported to the 2.4 driver, and I will do so.

Quoted 6 lines

Additionally, we get rid of a useless label.

The patch is untested (I don't own any supported chip) but quite straightforward IMHO.

Please apply,

Applied, thanks.

greg k-h

#7 lore raw
In reply to Eric
Quoted 4 lines

This looks to me like a lm75-compatible or adm1021-compatible chip; the address range 48-4f is traditionally for temperature sensors; it wouldn't be that unusual for a board with a w83627hf (with 3 temp sensors) to have another chip to provide additional temperatures.

Granted, it could be an extra temperature sensor. Except that it doesn't change values, and shuts the system down when you try to use it ;)

Quoted 6 lines

I agree w/ Khali that you can watch the registers with i2cdump (esp. at data address 0x00) to see if it varies with CPU load, if so try loading lm75.

The first 4 locations look somewhat like temp, control, hyst, and max to me.... then again, maybe not.

109 degrees C seems slightly excessive for early spring, don't you think? Plus there is too much difference between hyst and max, and anyway hyst = 16 degrees C doesn't make much sense, and max = 114 degrees C doesn't make any sense either.

I'm sorry but that chip doesn't look like an LM75 to me at all, and since it was already proved that it wasn't adm1021-compatible...

Quoted 3 lines

I see the lm75 section in sensors-detect has grown a lot, I don't pretend to understand it all but perhaps there is a new case here or perhaps it is too restrictive?

It hasn't changed much. The extra code is mainly there to refine the confidence value we give to the chip (from 6 down to 3). The main detection trick is unchanged, and relies of the fact that the LM75 addresses registers over 3 bits only, so values cycle every 8 bytes. This is obviously not the case here, but I agree that a LM75-compatible chip wouldn't *have* to behave the same way.

Quoted 2 lines

Our first guess for a chip in the range 48-4f should always be lm75 or compatible.

I don't see no reason for this. There are many more chips that live in this area, especially at 0x4c-0x4e, that are not compatible with the LM75 at all, and that are much more likely to be found in modern computers (Winbond-like emulation left apart).

Quoted 2 lines

Eric perhaps you can look at your board and find out what chip this is, that would be a big help to us.

Sure it would.

Also, Eric, could you try dumping the chip in word mode (i2cdump 0 0x4e w)? This will let us know is some registers are word-sized, which would help identify the chip.

Thanks.

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

root@pathfinder eric # i2cdump 0 0x4e w
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x4e, mode word You have five seconds to reconsider and press CTRL-C!

     0,8  1,9  2,a  3,b  4,c  5,d  6,e  7,f

00: ff6d ff2d ff10 ff72 ff00 ff80 ff0f ff00
08: ff00 ff00 ffff ff00 ff00 ff00 ffe0 ffff
(...)

I.e. no, it doesn't support word mode.

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

'greetings all list members

(transcript of the original conversation is at the bottom)

Quoted 2 lines

You're lucky it did come back. I think I remember we once had a report of such a case and the system never came back :(

Well the main reason I figured wanted to use this chip was to know what was behind it :) Guess that was kinda stupid.

Quoted 1 line

I'd like the brand and model of the motherboard too.

The motherboard is an MSI-6728, which is also known as a MSI 865PE Neo2-PLS see
http://www.msi.com.tw/program/products/mainboard/mbd/pro_mbd_detail.php?UIDR8
for more gory details.

Quoted 3 lines

I actually think that whatever you have at 0x4e, it isn't an adm1021 compatible chip. You already have a full featured monitoring chip on the board W83627HF, adding an old LM84 wouldn't make any sense.

Well I'm not that much sensor chips and all, but my guess was that it could access data the W83627HF could not access.

About the version I used, I couldn't find a version number in sensors-detect but I'm fairly sure this is 2.8.5 (from sensors --version) or better. To exclude any possible miscommunications I added the entire adm1021_detect function at the bottom of this email.

Kind regards,

Eric

root@pathfinder eric # i2cdump 0 0x2e
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x2e, mode byte
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    0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
10: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX
f0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX    XXXXXXXXXXXXXXXX

root@pathfinder lib # cat /usr/sbin/sensors-detect |grep -A 52 adm1021_detect
sub adm1021_detect
{
my ($chip, $file,$addr) = @_;
return if $chip = 0 and i2c_smbus_read_byte_data($file,0xfe) != 0x41 ||

                          (i2c_smbus_read_byte_data($file,0xff) & 0xf0) 
!= 0x00;
  return if $chip = 1 and i2c_smbus_read_byte_data($file,0xfe) != 0x41 ||
                          (i2c_smbus_read_byte_data($file,0xff) & 0xf0) 

!= 0x30;
return if $chip = 4 and i2c_smbus_read_byte_data($file,0xfe) != 0x49; return if $chip = 5 and i2c_smbus_read_byte_data($file,0x04) != 0x00; return if $chip = 6 and i2c_smbus_read_byte_data($file,0xfe) != 0x23; return if $chip = 3 and i2c_smbus_read_byte_data($file,0xfe) != 0x4d ||

                           i2c_smbus_read_byte_data($file,0xff) != 0x01;
  return if $chip = 7 and i2c_smbus_read_byte_data($file,0xfe) != 0x54;
  # The remaining things are flaky at best. Perhaps something can be done
  # with the fact that some registers are unreadable?
  return if (i2c_smbus_read_byte_data($file,0x02) & 0x03) != 0;
  # Extra checks for MAX1617 and LM84, since those are often misdetected
  if ($chip = 2 || $chip = 5)
  {
    # Increase the misdetect value each time a temperature doesn't
    # match reasonable expectations
    my $misdetect = 0;
    # Negative temperatures
    $misdetect++ if ((my $lte=i2c_smbus_read_byte_data($file,0x00)) & 0x80);
    $misdetect++ if ((my $rte=i2c_smbus_read_byte_data($file,0x01)) & 0x80);
    # Negative high limits
        my ($lhi, $rhi);
    if (($lhi=i2c_smbus_read_byte_data($file,0x05)) & 0x80)
    {
      $misdetect++;
      $lhi-%6;
    }
    if (($rhi=i2c_smbus_read_byte_data($file,0x07)) & 0x80)
    {
      $misdetect++;
      $rhi-%6;
    }
    # Low limits over high limits
    my $llo=i2c_smbus_read_byte_data($file,0x06);
    my $rlo=i2c_smbus_read_byte_data($file,0x08);
    $llo-%6 if ($llo & 0x80);
    $rlo-%6 if ($rlo & 0x80);
    $misdetect++ if $llo > $lhi;
    $misdetect++ if $rlo > $rhi;
    return if $misdetect >= 4;
        # Also return if all six bytes have the same value
        return if $lte = $rte and $lte = $lhi and $lte = $rhi
      and $lte = $llo and $lte = $rlo;
  }
  return 3 if $chip = 2;
  return 7 if $chip <= 3;
  return 5;
}
Quoted 61 lines · Jean Delvare

[Please reply to the list, not to me]

Quoting Eric <[email protected]>:

Quoted 8 lines

Based on the output of sensors-detect I insmodded adm1021:

Driver `adm1021' (should be inserted):
Detects correctly:
* Bus SMBus I801 adapter at 0c00' (Algorithm unavailable) Busdriver i2c-i801', I2C address 0x4e
Chip `National Semiconductor LM84' (confidence: 5)

Quoted 6 lines

The module was build from a 2.6.5-rc1 kernel tree (SMP). After insmodding the module the machine shut down instantly, which could have only been caused because the hardware detected _something_ critical enough that it shut down the system immediatly. Initial tries to power up again were futile, only after unplugging and giving it a few minutes the machine came back up again (*phew*).

You're lucky it did come back. I think I remember we once had a report of such a case and the system never came back :(

Quoted 3 lines

I can't give you anything other helpfull information concerning what happened, simply because there was none given. However I put the details of the machine below.

I'd like the brand and model of the motherboard too.

Quoted 2 lines

Whatever happened, it shouldn't have happened :-) (I'm just glad the machine came back on again.)

I actually think that whatever you have at 0x4e, it isn't an adm1021 compatible chip. You already have a full featured monitoring chip on the board W83627HF, adding an old LM84 wouldn't make any sense.

That said, yes, we still should try to prevent what happened to you from happening to others. This could include:

1* Refine sensors-detect again. I thought it was OK after my latest changes, but obviously it isn't (providing this was sensors-detect from lm_sensors 2.8.5). One thing that would help would be to know what the mysterious chip is, and add detection for it in sensors-detect (even if it's not a hardware monitoring chip). Any idea of what this could be?

2* Refine adm1021's detection procedure too.

3* Drop adm1021's limit init. This was already done in the 2.4 driver and should have been done in 2.6 as well.

Quoted 1 line

let me know if you require any other information

I'd appreciate a dump of the faulty chip (i2cdump 0 0x2e), this could help us find out what it is and possibly prevent it from being recognized as an adm1021-compatible one.

Thanks and sorry for the trouble.

author
#10 lore raw
In reply to Eric

Well, I should have seen it, so consider me a stoopid as well :-)

root@pathfinder eric # i2cdump 0 0x4e
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x4e, mode byte
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    0123456789abcdef
00: 6d 2d 10 72 00 80 0f 00 00 00 ff 00 00 00 e0 ff    m-?r.??.......?.
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
Quoted 26 lines · Jean Delvare

Quoting Eric <[email protected]>:

Quoted 3 lines

About the version I used, I couldn't find a version number in sensors-detect

We don't include any version in it because it would be a real pain to update it with each new release.

Quoted 3 lines

but I'm fairly sure this is 2.8.5 (from sensors --version) or better.

So you did the right thing, this was the right way to get the information :)

Quoted 2 lines

root@pathfinder eric # i2cdump 0 0x2e

OK, I am too stupid. This was "i2cdump 0 0x4e", since the mysterious chip is as 0x04e.

#11 lore raw
In reply to Eric

This looks to me like a lm75-compatible or adm1021-compatible chip; the address range 48-4f is traditionally for temperature sensors; it wouldn't be that unusual for a board with a w83627hf (with 3 temp sensors) to have another chip to provide additional temperatures.

I agree w/ Khali that you can watch the registers with i2cdump (esp. at data address 0x00) to see if it varies with CPU load, if so try loading lm75.

The first 4 locations look somewhat like temp, control, hyst, and max to me.... then again, maybe not.

I see the lm75 section in sensors-detect has grown a lot, I don't pretend to understand it all but perhaps there is a new case here or perhaps it is too restrictive?

Our first guess for a chip in the range 48-4f should always be lm75 or compatible.

Eric perhaps you can look at your board and find out what chip this is, that would be a big help to us.

mds

Quoted 56 lines · Eric

Well, I should have seen it, so consider me a stoopid as well :-)

root@pathfinder eric # i2cdump 0 0x4e
No size specified (using byte-data access)
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x4e, mode byte
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    0123456789abcdef
00: 6d 2d 10 72 00 80 0f 00 00 00 ff 00 00 00 e0 ff    m-?r.??.......?.
10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
Quoted 26 lines · Jean Delvare

Quoting Eric <[email protected]>:

Quoted 3 lines

About the version I used, I couldn't find a version number in sensors-detect

We don't include any version in it because it would be a real pain to update it with each new release.

Quoted 3 lines

but I'm fairly sure this is 2.8.5 (from sensors --version) or better.

So you did the right thing, this was the right way to get the information :)

Quoted 2 lines

root@pathfinder eric # i2cdump 0 0x2e

OK, I am too stupid. This was "i2cdump 0 0x4e", since the mysterious chip is as 0x04e.

author
#12 lore raw
In reply to Eric

root@pathfinder eric # i2cdump 0 0x4e w
WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0, address 0x4e, mode word
You have five seconds to reconsider and press CTRL-C!

     0,8  1,9  2,a  3,b  4,c  5,d  6,e  7,f

00: ff6d ff2d ff10 ff72 ff00 ff80 ff0f ff00 08: ff00 ff00 ffff ff00 ff00 ff00 ffe0 ffff 10: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 18: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 20: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 28: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 30: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 38: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 40: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 48: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 50: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 58: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 60: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 68: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 70: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 78: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 80: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 88: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 90: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 98: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
a0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
a8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
b0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
b8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
c0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
c8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
d0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
d8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
e0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
e8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
f0: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
f8: ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 root@pathfinder eric #

Regards,

Eric

Quoted 63 lines · Jean Delvare
Quoted 5 lines

This looks to me like a lm75-compatible or adm1021-compatible chip; the address range 48-4f is traditionally for temperature sensors; it wouldn't be that unusual for a board with a w83627hf (with 3 temp sensors) to have another chip to provide additional temperatures.

Granted, it could be an extra temperature sensor. Except that it doesn't change values, and shuts the system down when you try to use it ;)

Quoted 7 lines

I agree w/ Khali that you can watch the registers with i2cdump (esp. at data address 0x00) to see if it varies with CPU load, if so try loading lm75.

The first 4 locations look somewhat like temp, control, hyst, and max to me.... then again, maybe not.

109 degrees C seems slightly excessive for early spring, don't you think? Plus there is too much difference between hyst and max, and anyway hyst = 16 degrees C doesn't make much sense, and max = 114 degrees C doesn't make any sense either.

I'm sorry but that chip doesn't look like an LM75 to me at all, and since it was already proved that it wasn't adm1021-compatible...

Quoted 4 lines

I see the lm75 section in sensors-detect has grown a lot, I don't pretend to understand it all but perhaps there is a new case here or perhaps it is too restrictive?

It hasn't changed much. The extra code is mainly there to refine the confidence value we give to the chip (from 6 down to 3). The main detection trick is unchanged, and relies of the fact that the LM75 addresses registers over 3 bits only, so values cycle every 8 bytes. This is obviously not the case here, but I agree that a LM75-compatible chip wouldn't *have* to behave the same way.

Quoted 3 lines

Our first guess for a chip in the range 48-4f should always be lm75 or compatible.

I don't see no reason for this. There are many more chips that live in this area, especially at 0x4c-0x4e, that are not compatible with the LM75 at all, and that are much more likely to be found in modern computers (Winbond-like emulation left apart).

Quoted 3 lines

Eric perhaps you can look at your board and find out what chip this is, that would be a big help to us.

Sure it would.

Also, Eric, could you try dumping the chip in word mode (i2cdump 0 0x4e w)? This will let us know is some registers are word-sized, which would help identify the chip.

Thanks.