ACPI reads wrong temperature after loading
Hallo Peter, Markus,
Quoted 14 lines · Peter Mahlknecht
Quoted 13 lines · Markus Rechberger
Quoted 7 lines · Peter Mahlknecht
I have here a strange problem:
after loading theem28xx_cx25843module in/proc/acpi/thermal_zone/THRM/temperaturea wrong temperature (65535 C) which forces a shutdown on my notebook ("Critical temperature reached (65535 C). Shutting down."). Same thing happens if I load the lm90 module (hwmon driver for the temperaturesensor used by lm-sensors). Both modules depend oni2c_core, so maybe its an I²C bug. Any suggestions?I think the lmsensors mailinglist might be better for this! Jean Delvare might now more about it.
added the lm-sensors ML.
Quoted 7 lines
Quoted 1 line
also provide which kernel version you use.
Thanks for the fast reply,
I am using Debian Lenny (2.6.26-1-686) on my notebook (Samsung P40 with the latest Bios 09HK), but had the same problem also with the 2.6.18-6-686 (Lenny) and with Ubuntu Hardy Heron (think the kernel was 2.6.24).
It would help if I could see the source code of module em28xx_cx25843, but unfortunately I have no idea where that driver lives. Markus?
Peter, most probably you have an LM90-compatible sensor chip on the SMBus and ACPI uses it for thermal regulation and doesn't enjoy another driver (e.g. lm90) accessing the same chip. That the lm90 driver causes trouble in that case is more or less expected. That the em28xx_cx25843 driver does is more surprising, but without reading the code I can't tell why.
Please try the following workaround: blacklist the i2c-i801 driver (or rmmod it before loading em28xx_cx25843.)
It would also be great if you could give a try to kernel 2.6.27 and report if you see the following message in the kernel logs:
ACPI: * resource * [0x*-0x*] conflicts with ACPI region * [0x*-0x*]
ACPI: Device needs an ACPI driver
For reference, please also attach the output of dmidecode on this laptop.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 19 lines · Jean Delvare
Hallo Peter, Markus,
Quoted 16 lines · Peter Mahlknecht
Quoted 14 lines · Markus Rechberger
Quoted 7 lines · Peter Mahlknecht
I have here a strange problem:
after loading theem28xx_cx25843module in/proc/acpi/thermal_zone/THRM/temperaturea wrong temperature (65535 C) which forces a shutdown on my notebook ("Critical temperature reached (65535 C). Shutting down."). Same thing happens if I load the lm90 module (hwmon driver for the temperaturesensor used by lm-sensors). Both modules depend oni2c_core, so maybe its an I²C bug. Any suggestions?I think the lmsensors mailinglist might be better for this! Jean Delvare might now more about it.
added the lm-sensors ML.also provide which kernel version you use.
Quoted 9 lines
Quoted 5 lines
Thanks for the fast reply,
I am using Debian Lenny (2.6.26-1-686) on my notebook (Samsung P40 with the latest Bios 09HK), but had the same problem also with the 2.6.18-6-686 (Lenny) and with Ubuntu Hardy Heron (think the kernel was 2.6.24).It would help if I could see the source code of module
em28xx_cx25843, but unfortunately I have no idea where that driver lives. Markus?
http://mcentral.de/hg/~mrec/em28xx-new/file/ca209b1d4076/cx25843/em28xx-cx25843.c
Quoted 13 lines
Peter, most probably you have an LM90-compatible sensor chip on the SMBus and ACPI uses it for thermal regulation and doesn't enjoy another driver (e.g. lm90) accessing the same chip. That the lm90 driver causes trouble in that case is more or less expected. That the
em28xx_cx25843driver does is more surprising, but without reading the code I can't tell why.Please try the following workaround: blacklist the i2c-i801 driver (or rmmod it before loading
em28xx_cx25843.)It would also be great if you could give a try to kernel 2.6.27 and report if you see the following message in the kernel logs:
Quoted 9 lines
ACPI: * resource * [0x*-0x*] conflicts with ACPI region * [0x*-0x*]
ACPI: Device needs an ACPI driverFor reference, please also attach the output of dmidecode on this laptop.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 5 lines · Markus Rechberger
Quoted 2 lines · Jean Delvare
It would help if I could see the source code of module
em28xx_cx25843, but unfortunately I have no idea where that driver lives. Markus?http://mcentral.de/hg/~mrec/em28xx-new/file/ca209b1d4076/cx25843/em28xx-cx25843.c
This driver only attaches to (7-bit) address 0x44, while the lm90 driver probes for devices at 0x4c and 0x4d. So I have to admit I am surprised that loading both drivers leads to the same result.
One note about the em28xx-cx25843 driver: it doesn't check for the right i2c adapter functionality flags. The driver makes use of raw I2C transactions to read from and write to the device, so it should check for I2C_FUNC_I2C, but instead of that I see the following code:
566 /* Check if the adapter supports the needed features */
567 if (!i2c_check_functionality
568 (adapter,
569 I2C_FUNC_SMBUS_READ_BYTE |
570 I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
571 return 0;
This is incorrect and should be fixed.
Another thing that should be fixed in this driver is the use of a "template" i2c_client. This is inefficient in terms of performance, disk space and memory so it should be avoided. Just setting fields individually is much better.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 11 lines · Jean Delvare
Quoted 5 lines · Markus Rechberger
Quoted 2 lines · Jean Delvare
It would help if I could see the source code of module
em28xx_cx25843, but unfortunately I have no idea where that driver lives. Markus?http://mcentral.de/hg/~mrec/em28xx-new/file/ca209b1d4076/cx25843/em28xx-cx25843.c
This driver only attaches to (7-bit) address
0x44, while the lm90 driver probes for devices at0x4cand0x4d. So I have to admit I am surprised that loading both drivers leads to the same result.
is there some debug that can be enabled in the i2c framework which might help you forward?
Quoted 12 lines
One note about the em28xx-cx25843 driver: it doesn't check for the right i2c adapter functionality flags. The driver makes use of raw I2C transactions to read from and write to the device, so it should check for
I2C_FUNC_I2C, but instead of that I see the following code:566 /* Check if the adapter supports the needed features */ 567 if (!i2c_check_functionality
568 (adapter,
569I2C_FUNC_SMBUS_READ_BYTE|
570I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
571 return 0;
Quoted 7 lines
This is incorrect and should be fixed.
Another thing that should be fixed in this driver is the use of a "template"
i2c_client. This is inefficient in terms of performance, disk space and memory so it should be avoided. Just setting fields individually is much better.
thanks for the hints, I'll adapt it within the next days.
Markus
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Quoted 10 lines · Markus Rechberger
Quoted 6 lines · Jean Delvare
Quoted 1 line · Markus Rechberger
http://mcentral.de/hg/~mrec/em28xx-new/file/ca209b1d4076/cx25843/em28xx-cx25843.c
This driver only attaches to (7-bit) address
0x44, while the lm90 driver probes for devices at0x4cand0x4d. So I have to admit I am surprised that loading both drivers leads to the same result.is there some debug that can be enabled in the i2c framework which might help you forward?
I don't think so. Let's wait for Peter to do the tests I suggested first.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi,
Quoted 2 lines
Please try the following workaround: blacklist the i2c-i801 driver (or rmmod it before loading
em28xx_cx25843.)
tested this, and it works: as long as i2c-i801 isn't loaded i get the right temperatures, also if I have loaded em28xx_cx25843 or lm90 (or both).
Quoted 5 lines
It would also be great if you could give a try to kernel 2.6.27 and report if you see the following message in the kernel logs:
ACPI: * resource * [0x*-0x*] conflicts with ACPI region * [0x*-0x*]
ACPI: Device needs an ACPI driver
I will try. Hope to get the new kernel working tonight
Quoted 2 lines
For reference, please also attach the output of dmidecode on this laptop.
I wasn't shure if attaching works, so i put it on http://stud3.tuwien.ac.at/~e0526314/dmidecode_log
Peter Mahlknecht
Signature · 7 lines
GMX Download-Spiele: Preizsturz! Alle Puzzle-Spiele Deluxe über 60% billiger. http://games.entertainment.gmx.net/de/entertainment/games/download/puzzle/index.html _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi,
Quoted 3 lines
I don't think so. Let's wait for Peter to do the tests I suggested first.
I got the new kernel (2.6.27.4) running, here is what it outputs during boot:
Nov 1 22:48:30 laptop-mali kernel: [ 9.670886] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 19 (level, low) -> IRQ 19 Nov 1 22:48:30 laptop-mali kernel: [ 9.670946] ACPI: I/O resource 0000:00:1f.3 [0x18e0-0x18ff] conflicts with ACPI region SMBI [0x18e0-0x18ef] Nov 1 22:48:30 laptop-mali kernel: [ 9.671002] ACPI: Device needs an ACPI driver
as just wrote before, as long as i2c-i801 isn't loaded i get the right temperatures, also if em28xx_cx25843 or lm90 (or both) are loaded. dmesg output from my notebook can be found here: http://stud3.tuwien.ac.at/~e0526314/dmidecode_log
Thanks for the help
Peter
Signature · 7 lines
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Peter, Markus,
Quoted 4 lines · Peter Mahlknecht
I got the new kernel (2.6.27.4) running, here is what it outputs during boot:
Nov 1 22:48:30 laptop-mali kernel: [ 9.670886] i801_smbus 0000:00:1f.3: PCI INT B -> GSI 19 (level, low) -> IRQ 19 Nov 1 22:48:30 laptop-mali kernel: [ 9.670946] ACPI: I/O resource 0000:00:1f.3 [0x18e0-0x18ff] conflicts with ACPI region SMBI [0x18e0-0x18ef] Nov 1 22:48:30 laptop-mali kernel: [ 9.671002] ACPI: Device needs an ACPI driver
OK. This confirms that ACPI is using the SMBus so we shouldn't. With kernels >= 2.6.27, you can boot with parameter acpi_enforce_resources=strict and the i2c-i801 driver will decline attaching to the SMBus.
Quoted 4 lines
as just wrote before, as long as i2c-i801 isn't loaded i get the right temperatures, also if
em28xx_cx25843or lm90 (or both) are loaded. dmesg output from my notebook can be found here:
http://stud3.tuwien.ac.at/~e0526314/dmidecode_log
OK, thanks. We may use the DMI data to blacklist your laptop from i2c-i801, although I'd prefer to use an ACPI-based approach.
Another test I'd like you to do is:
# rmmod em28xx_cx25843 # rmmod lm90 # modprobe i2c-i801 # modprobe i2c-dev # i2cdetect -l (find the i2c bus number for "SMBus I801 adapter at 18e0") # i2cdetect n (where n is the bus number in question)
I wonder if this will confuse ACPI the same way loading em28xx_cx25843 does. I don't think em28xx_cx25843 does more to the SMBus that i2cdetect will, so I _think_ i2cdetect should cause the same problem. But I'd like a confirmation, because I am surprised that just probing the bus causes the problem.
Markus, this problem could be mitigated if em28xx_cx25843 was properly checking the class of i2c adapters it is going to probe. The cx25843_attach_adapter function should look like this:
static int cx25843_attach_adapter(struct i2c_adapter *adapter)
{
if (!(adapter.class & I2C_CLASS_TV_ANALOG))
return 0;
printk(KERN_INFO"cx25843.c: starting probe for adapter %s (0x%x)\n",
adapter->name, adapter->id);
return i2c_probe(adapter, &addr_data, &cx25843_detect_client);
}For future kernels, it should even be converted to the new-style i2c device driver matching model, so that you don't have to probe anything.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
HI,
Quoted 6 lines · Peter Mahlknecht
Quoted 1 line
I got the new kernel (2.6.27.4) running, here is what it outputs during
boot:
Quoted 1 line
Nov 1 22:48:30 laptop-mali kernel: [ 9.670886] i801_smbus0000:00:1f.3: PCI INT B -> GSI 19 (level, low) -> IRQ 19
Quoted 1 line
Nov 1 22:48:30 laptop-mali kernel: [ 9.670946] ACPI: I/O resource
Quoted 8 lines
0000:00:1f.3 [0x18e0-0x18ff] conflicts with ACPI region SMBI [0x18e0-0x18ef]
Quoted 1 line
Nov 1 22:48:30 laptop-mali kernel: [ 9.671002] ACPI: Device needs anACPI driver
OK. This confirms that ACPI is using the SMBus so we shouldn't. With kernels >= 2.6.27, you can boot with parameter acpi_enforce_resources=strict and the i2c-i801 driver will decline attaching to the SMBus.
Has this the same effect as just not loading the i2c-i801 driver? Or what other functions then attaching to the SMBus has the i2c-i801?
Quoted 11 lines
Another test I'd like you to do is:
# rmmod em28xx_cx25843 # rmmod lm90 # modprobe i2c-i801 # modprobe i2c-dev # i2cdetect -l (find the i2c bus number for "SMBus I801 adapter at 18e0") # i2cdetect n (where n is the bus number in question)
Quoted 2 lines
I wonder if this will confuse ACPI the same way loading
em28xx_cx25843does.
It does:
laptop-mali:/home/mali# i2cdetect -l
i2c-0 smbus SMBus I801 adapter at 18e0 SMBus adapter
laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature
temperature: 41 C
laptop-mali:/home/mali# i2cdetect 0
WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- 08 -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: 30 -- 32 -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- --
50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- --
laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature
temperature: 65535 CPeter
Signature · 6 lines
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Peter,
Sorry for the late answer, I fell ill and had to stay in bad for a couple days.
Quoted 7 lines · Peter Mahlknecht
Quoted 4 lines
OK. This confirms that ACPI is using the SMBus so we shouldn't. With kernels >= 2.6.27, you can boot with parameter acpi_enforce_resources=strict and the i2c-i801 driver will decline attaching to the SMBus.
Has this the same effect as just not loading the i2c-i801 driver? Or what other functions then attaching to the SMBus has the i2c-i801?
This has roughly the same effect, yes. The only difference is that acpi_enforce_resources=strict doesn't prevent the i2c-i801 driver from loading, so it still appears in "lsmod" and wastes a small amount of memory. But I doubt you really care in practice.
Quoted 26 lines
Quoted 11 lines
Another test I'd like you to do is:
# rmmod em28xx_cx25843 # rmmod lm90 # modprobe i2c-i801 # modprobe i2c-dev # i2cdetect -l (find the i2c bus number for "SMBus I801 adapter at 18e0") # i2cdetect n (where n is the bus number in question)Quoted 2 lines
I wonder if this will confuse ACPI the same way loading
em28xx_cx25843does.It does:
laptop-mali:/home/mali# i2cdetect -l i2c-0 smbus SMBus I801 adapter at 18e0 SMBus adapter laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature temperature: 41 C laptop-mali:/home/mali# i2cdetect 0 WARNING! This program can confuse your I2C bus, cause data loss and worse! I will probe file /dev/i2c-0. I will probe address range 0x03-0x77. Continue? [Y/n] y 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- 08 -- -- -- -- -- -- --
Quoted 8 lines
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: 30 -- 32 -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- 44 -- -- -- -- -- -- -- 4c -- -- -- 50: 50 -- 52 -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- 69 -- -- -- -- -- -- laptop-mali:/home/mali# cat /proc/acpi/thermal_zone/THRM/temperature temperature: 65535 C
OK, so the mere fact of probing the bus with "SMBus quick commands" is enough to confuse ACPI. I guess that the i2c-i801 driver is changing some hardware settings (.e.g. SMBus vs. I2C timing or PEC flag) to something ACPI doesn't expect. If we want the i2c-i801 driver to ever cooperate on hardware like yours, we will have to teach the i2c-i801 driver how to only touch the configuration registers when it needs to and how to restore all the settings when it is done. But at the moment there is no safe way to do this anyway so I won't spend time on this. The back-listing should work well enough.
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors