Support DB Entry 1770
Quoted 6 lines
----- Original Message -----
From: "Nobody" <[email protected]>
To: <[email protected]>
Sent: Friday, September 10, 2004 06:53
Subject: ---==Lm_sensorsSupport DB Entry ==---
Quoted 6 lines
Your
Lm_sensorssupport entry has been updated.Please go to http://secure.netroedge.com/~lm78/support.html to check the status of your entry.
Ticket # 1770
Hi,
I couldn't find a way to reply via the support ticket page. The problem was not solved on my end.
"sensors-detect" did in fact discover the W83781D device when probing the ISA bus, at 0x290 as you mentioned. I missed it before, but noticed it when I did not load the ali15x3 adapter driver, and scanned the ISA bus.
In "sensors.conf" I have tried 'chip "w83781d-*"' and 'chip "w83781d-isa-*"', but running "sensors" says "No sensors found!". Loaded modules are: w83781d, i2c_sensor, i2c_isa, i2c_core. I also tried with i2c_dev loaded, same result. Am I missing a module or module option? Is it possible that the chip is detected on the ISA bus but not accessible (misconfigured?) or not wired (unlikely?). Do I need to reboot when switching between SMBus and ISA? If I wanted to use ISA but still see the EEPROMs, would I still hang the bus? Would I load both the ali15x3 and isa adapter drivers? How would I configure sensors.conf? With separate "w83781d-i2c-*" and "w83781d-isa-*" sections, with ALL "w83781d-i2c-*" values ignored with optionally commented label, compute and set?
Leif
/etc/modules has:
# I2C adapter drivers
#i2c-ali15x3
i2c-isa
# I2C chip drivers
w83781d
#eeprom
/etc/modules.conf has:
# I2C module options
alias char-major-89 i2c-dev
#options w83781d ignore=0,0x2d
#options w83781d ignore=1,0x2d
sensors.conf contains only this text (excluding the END comment below):
chip "w83781d-*"
label in0 "VCore 1"
label in1 "VCore 2"
label in2 "+3.3V"
label in3 "+5V"
label in4 "+12V"
label in5 "-12V"
label in6 "-5V"
label temp1 "M/B Temp"
label temp2 "CPU Temp"
label fan2 "CPU Fan"
ignore temp3
ignore fan1
ignore fan3
compute in3 ((6.8/10)+1)*@ , @/((6.8/10)+1)
compute in4 ((28/10)+1)*@ , @/((28/10)+1)
compute in5 -(210/60.4)*@ , -@/(210/60.4)
compute in6 -(90.9/60.4)*@ , -@/(90.9/60.4)
set vrm 8.4 # 2.0V AMD K6-III+ 450/ACZ
set in0_min vid * 0.95
set in0_max vid * 1.05
set in1_min vid * 0.95
set in1_max vid * 1.05
set in2_min 3.3 * 0.90
set in2_max 3.3 * 1.10
set in3_min 5.0 * 0.95
set in3_max 5.0 * 1.05
set in4_min 12 * 0.95
set in4_max 12 * 1.05
set in5_max -12 * 0.95
set in5_min -12 * 1.05
set in6_max -5 * 0.95
set in6_min -5 * 1.05
set temp1_over 35
set temp1_hyst 30
set temp2_over 40
set temp2_hyst 35
set fan2_div 2
set fan2_min 3250
set beep_enable 0Quoted 11 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Saturday, September 11, 2004 03:18
Subject: Re: Support DB Entry 1770Attached is a modified patch that will make the failure more verbose. Please revert the previous patch, apply this one, and test again.
The patch will also ignore the step 2 error, so that we can see
whether
Quoted 1 line
or not this is the only step failing.
<defiant> [2004-09-11@13:54:07] ~ -> modprobe w83781d
=> /var/log/syslog <=
Sep 11 13:54:10 defiant kernel: i2c-core: driver w83781d registered. Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: Detection of w83781d
chip failed at step 2 (0x61 != 0x60)
Quoted 3 lines
Alternatively, you can try to load the w83781d module with the "force‘91,0x290" parameter and see how it goes. This should skip all the detection steps.
Tried this, "sensors" still says "No sensors found!" First two syslog lines are same as above, minus the third "failed" line. "sensors-detect" still detects the chip. Have been applying these two patches to a kernel configured with no PM whatsoever, no ACPI, ISA PnP disabled in the kernel.
Leif
Quoted 15 lines
----- Original Message -----
From: "Leif W" <[email protected]>
To: "LM Sensors" <[email protected]>
Sent: Saturday, September 11, 2004 14:05
Subject: Re: Support DB Entry 1770Quoted 9 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Saturday, September 11, 2004 03:18
Subject: Re: Support DB Entry 1770Alternatively, you can try to load the w83781d module with the "force‘91,0x290" parameter and see how it goes. This should skip
all
Quoted 3 lines
Quoted 1 line
the detection steps.
Tried this, "sensors" still says "No sensors found!" First two
syslog
Quoted 6 lines
lines are same as above, minus the third "failed" line. "sensors-detect" still detects the chip. Have been applying these two patches to a kernel configured with no PM whatsoever, no ACPI, ISA PnP disabled in the kernel.
Leif
Got it working with "modprobe w83781d force_w83781d‘91,0x290". I guess the "force" alone tried something different. Not sure if this problem is solvable. If it is, great. If not, the workaround as explained in the docs could be further elaborated.
It's mentioned in the docs (
http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/chips/w83781d ) that the chip gets misidentified. However my chip was detected, is that the same as identified? Also, the docs says:
(modprobe w83781d force_CHIP=BUS,0x2d where CHIP is the chip name and BUS is your i2c bus number -
cat /proc/bus/i2c to see a list of bus numbers)
But I have no /proc/bus/i2c (file or directory). I can't find the corresponding data in /sys , either because I don't know where to look, or it's just not there. I suggest an update to add a note explaining how to get the right bus number in kernel 2.4 and 2.6. Additionally make a clearer distinction between ISA bus/address and I2C bus/address and list typical numbers for this device: ISA bus 9191 / address 0x290 and I2C bus 0 or 1 / address 0x2d. Also helpful would be both the modprobe syntax (as shown) and the modules.conf syntax.
# Mail client won't let me enter tabs.
<DOC_begin>
W8378* PROBLEMS
-----------------
Known problems:
- Some chips are misidentified even if successfully detected.
This is caused by the chip having the wrong WCHIPID register
value, so there is no fix. The workaround is to use the
force_CHIP parameter.
modprobe format:
modprobe w83781d force_CHIP=BUS,ADDR
modules.conf format:
options w83781d force_CHIP=BUS,ADDR
Example values, comma separated, use only one, use only ISA or I2C:
CHIP : w83781d
I2C BUS : 0, 1
I2C ADDR: 0x2d
ISA BUS : 9191
ISA ADDR: 0x290
Find your specific bus:
kernel 2.4 I2C: cat /proc/bus/i2c
kernel 2.4 ISA: ???
kernel 2.6 I2C: ???
kernel 2.6 ISA: ???
Find your specific address:
kernel 2.4 I2C: ???
kernel 2.4 ISA: ???
kernel 2.6 I2C: ???
kernel 2.6 ISA: ???
See "Addresses scanned" sections under "Supported chips" above.</DOC_end>
Quoted 8 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Sunday, September 12, 2004 04:31
Subject: Re: Support DB Entry 1770regiesters belong to a so-called "auto-increment" range. This
basically
Quoted 5 lines
means that reading any register in this range will automatically increase the address pointer, those value we are reading from I/O address
0x295.I think I am now starting to understand what's going on. Something
else
Quoted 4 lines
is trying to access the chip at the very moment we are, most probably the BIOS. Why it does, I don't know. I thought that Asus started to implement such silly behaviors only recently, but it seems not. The SMBus locks you were experiencing speak for themselves.
:-\ Ahh well, I always thought they did a pretty good job in other regards. Fabrication of the boards was always nice, not sloppy looking like some other boards at the time. This particular board supports everything from early Pentiums up to the AMD K6-III+/450, and can even overclock it to 600 MHz as I did. It supports CPU Core voltages from 2.0 up to 3.5, and documented as well, rare for the day.
Quoted 5 lines
So, first of all, I have to tell you know that you should expect problems if you go on with using the w83781d driver on your system. It is likely that from times to times some readings will be completely wrong (BIOS reads interfering with yours). You could also experiment random reboots/halts (your reads interfering with the BIOSes).
Another thing happened last night: the system started "chirping". Not full beeps, variable intervals, variable durations but not long enough to make a recognizable "beep" sound, about the same volume and tone though, except the volume was sometimes less due to very short beep duration. The beeps were of very short duration, and I hadn't noticed them for some time (due to other noises in the area like TV and music). The beeps seemed to coincide with application execution when I did a controlled shutdown today.
When I first started hearing them I thought I was imagining something. Probably similar to those gag devices you buy at a joke store and put in concealed locations in someone else's home or workplace, preferably with an concealed video camera and microphone, and watch them slowly start to go insane and tear the place apart looking for the noise. :-)
I was trying to sleep so I power-cycled the system immediately and it went away. I didn't bother to see if unloading the driver would stop the chirps. I suspected that the hardware was in some funky state and might not fix itself, and was too inpatient to test. I'll try it today. .. As I suspected, the module is unloaded, and the chirping continues. :D Rebooting clears it, so at least power cycling is not required.
Quoted 2 lines
Why the sensors-detect script doesn't seem to be affected is above me. It didn't fail to detect the chip once, did it?
I've run it several times in a row, from immediately after a reboot and a module load, to after a both successful and failed module loads and then sensors attempt. Never failed to detect it.
I've got a suggestion for "sensors-detect". Command-line options for the specific tests to perform or skip would be cool, so I could run one command line. Otherwise, I've got to use an input file with my prompt-answers, run a command to take the file as input, run another command to dump STDOUT and STDERR to a file, and run another command to read the output file. For example this is what I'd use for this testing:
sensors-detect --pci-no --isa-yes --superio-no --summary-yes --commands- no
Quoted 2 lines
Quoted 2 lines
Actually, the data "appears" to be read correctly but temp2 is not correct. Also an ALARM where there should be none (in3). A result
of
Quoted 3 lines
Quoted 1 line
forcing?
This is just a guess, but the problem with temp2 could be caused by
the
Quoted 4 lines
BIOS concurent accesses.
The ALARM bits stay up until read, so you can usually see them once after the cause has disappeared. This is by chip design. If it does
not
Quoted 2 lines
disappear after one more read, then there is something wrong (possibly the BIOS breaking things when reading in our back again.
At first in0-in3 have ALARMs, after subsequent read in0-in2 ALARMs go away, but in3 remains.
Quoted 3 lines
You may want to check in the BIOS setup screen if there is some option to disable "active hardware monitoring" or whatever they called that. You may also want to upgrade BIOSes and see if it helps.
The BIOS is the latest and final official beta available for this mainboard (1105 Beta 005), required for proper AMD K6-plus identification in the BIOS and reportedly for full utilization of the AMD K6-plus cache. The only way to go is put an older, slower processor in the board, downgrade the BIOS, and see what happens. Everything else works. So I'll probably have to skip any sanity checks with sensors if I can't get this to work.
The closest thing to "active hardware monitoring" is in the "POWER MANAGEMENT SETUP" menu. Fan, thermal and voltage monitoring within the BIOS can be ignored, but ignoring does not help. :-(
Under the "CHIPSET FEATURES SETUP" there are two settings related to the ISA bus: "Passive Release" and "Delayed Transaction"; both are enabled (manual quoted below). In the mainboard manual, it says "The onboard hardware monitor uses the address 290H-297H so legacy ISA cards must not use this address or else conflicts will occur." It says this twice in different locations, so it must be important. I'm going to try disabling each and then both of these settings, if necessary I'll double check my ISA cards and then remove all of them and see if the problems go away.
"Passive Release (Enabled)
This is a mechanism that allows concurrency of CPU-to-ISA cycles. When this feature is enabled, it will be possible to re-arbitrate the PCI bus and allow the CPU to access PCI even when the M1543C has been granted the ISA bus.
Delayed Transaction (Disabled)
If Enabled, this frees the PCI Bus during CPU accessing of 8-bit ISA cards that normally consume about 50-60 PCI Clocks without PCI delayed transaction. If PCI Bus Masters cannot use the PCI Bus, leave this on the default setting of Disabled for some ISA cards that are not PCI 2.1 compliant."
Disabling "Delayed Transaction" seems to fix the problems. in3 has no persistent ALARM, temp2 is read correctly, temp2_over and temp2_hyst are connect, no chirping. The cost is a performance hit of 50-60 PCI clocks during ISA access (sensors, maybe modem and sound card). Funny they don't clearly state that enabling "Delayed Transaction" will break ISA access to the "Health Monitoring". "sensors" and "sensord" appear to work fine. No force or force_w83781d required. I'm going to take the latest patch and apply it the kernel, and enable my ACPI and then ISA PnP one by one, then both.
The only odd looking thing at this point is the "registering" annd "Detect" lines. It reports "0-0290", but should it be 9191-0290?
<SHELL>
<defiant> [2004-09-12@13:41:07] ~ -> modprobe w83781d
=> /var/log/syslog <=
Sep 12 13:41:13 defiant kernel: i2c-core: driver w83781d registered. Sep 12 13:41:13 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 12 13:41:13 defiant kernel: i2c_adapter i2c-0: client [w83781d] registered to adapter Sep 12 13:41:13 defiant kernel: registering 0-0290 Sep 12 13:41:13 defiant kernel: w83781d 0-0290: Detect OK
</SHELL>
Bottom line: Unless you use ISA only and disable the "Delayed Transaction" as described above, both the I2C (SMBus) and ISA busses are broken, making the sensor chip unusable.
Leif
Quoted 17 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Saturday, September 11, 2004 15:37
Subject: Re: Support DB Entry 1770Quoted 8 lines
<defiant> [2004-09-11@13:54:07] ~ -> modprobe w83781d
=>
/var/log/syslog<=Sep 11 13:54:10 defiant kernel: i2c-core: driver w83781d registered. Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: Detection ofw83781d chip failed at step 2 (
0x61!=0x60)
Quoted 4 lines
Odd. I wonder how this is even possible. What's more, I made the error on-fatal so I would have expected some more messages after that. No extra message means that either a critical failure occured (out of memory or similar), or the end of the detection was fine - but then
why
Quoted 1 line
would sensors not show the chip?
Shouldn't be out of physical memory. :-)
<SHELL>
<defiant> [2004-09-11@15:54:55] ~ -> free
total used free shared buffers
cached
Mem: 776560 98508 678052 0 5660
54232
-/+ buffers/cache: 38616 737944
Swap: 124980 0 124980
<defiant> [2004-09-11@15:55:06] ~ -> df /dev/shm
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 131072 12 131060 1% /dev/shm
<defiant> [2004-09-11@15:55:10] ~ ->
</SHELL>
Quoted 1 line
An even more verbose patch is attached, please try.
I'll try this momentarily. Results below.
<SHELL>
<defiant> [2004-09-11@19:27:38] ~ -> modprobe w83781d
=> /var/log/syslog <=
Sep 11 19:27:45 defiant kernel: i2c-core: driver w83781d registered. Sep 11 19:27:45 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 11 19:27:45 defiant kernel: i2c_adapter i2c-0: Detection of w83781d
chip failed at step 2 (0x61 != 0x60 at 0x295)
</SHELL>
Quoted 1 line
Please double-check. The second line should read "found force
parameter"
Quoted 1 line
instead of "found normal isa entry". If it doesn't, this would mean
that
Quoted 2 lines
the driver didn't understand your request. Either you didn't formulate it correctly, or this has to be another bug in the i2c subsystem.
The rest of these tests were done with patch "2" not "3", but the results are exactly the same. Ok, I see the "found force" in "/var/log/syslog" and "/var/log/debug". But there's "Ignoring 'force'" in "/var/log/syslog" and "/var/log/messages". It is looking on adapter 0 not 9191 as I specified. And "sensors" reports "No sensors found!".
<SHELL>
<defiant> [2004-09-11@15:45:02] ~ -> modprobe w83781d force‘91,0x290
=> /var/log/syslog <=
Sep 11 15:45:30 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:45:30 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:45:30 defiant kernel: : Ignoring 'force' parameter for
unknown chip atadapter 0, address 0x290
=> /var/log/messages <=
Sep 11 15:45:30 defiant kernel: : Ignoring 'force' parameter for
unknown chip atadapter 0, address 0x290
=> /var/log/debug <=
Sep 11 15:45:30 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:45:30 defiant kernel: i2c_adapter i2c-0: found force parameter
for adapter 9191, addr 0290
</SHELL>
The option below is the only one that seems to get this to work, and it appears to work fine when forced (i.e. "sensors" reports correct data).
<SHELL>
<defiant> [2004-09-11@15:50:42] ~ -> modprobe w83781d force_w83781d‘91,0x290
<defiant> [2004-09-11@15:50:48] ~ ->
=> /var/log/syslog <=
Sep 11 15:50:48 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: client [w83781d] registered to adapter Sep 11 15:50:48 defiant kernel: registering 0-0290
=> /var/log/debug <=
Sep 11 15:50:48 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: client [w83781d] registered to adapter Sep 11 15:50:48 defiant kernel: registering 0-0290
<defiant> [2004-09-11@15:50:52] ~ -> sensors
w83781d-isa-0290
Adapter: ISA adapter VCore 1: +2.00 V (min = +0.00 V, max = +4.08 V) ALARM VCore 2: +2.00 V (min = +0.00 V, max = +4.08 V) ALARM +3.3V: +3.57 V (min = +2.82 V, max = +3.79 V) ALARM +5V: +4.87 V (min = +0.97 V, max = +3.44 V) ALARM +12V: +12.10 V (min = +11.80 V, max = +0.00 V) -12V: -12.02 V (min = -0.45 V, max = -2.00 V) -5V: -4.89 V (min = -0.00 V, max = -0.00 V) CPU Fan: 3708 RPM (min = 21093 RPM, div = 2) M/B Temp: +29 C (high = -64 C, hyst = -95 C) CPU Temp: +0.0 C (high = +0 C, hyst = +0 C)
vid: +3.500 V
alarms:beep_enable:
Sound alarm disabled
<defiant> [2004-09-11@15:50:54] ~ ->
=> /var/log/syslog <=
Sep 11 15:50:54 defiant kernel: Starting device update
=> /var/log/debug <=
Sep 11 15:50:54 defiant kernel: Starting device update
</SHELL>
Actually, the data "appears" to be read correctly but temp2 is not correct. Also an ALARM where there should be none (in3). A result of forcing?
<SHELL>
<defiant> [2004-09-11@20:00:17] /etc -> sensors -s <defiant> [2004-09-11@20:01:45] /etc -> sensors w83781d-isa-0290
Adapter: ISA adapter in0: +2.00 V (min = +1.94 V, max = +2.14 V) in1: +2.00 V (min = +1.94 V, max = +2.14 V) in2: +3.57 V (min = +2.96 V, max = +3.63 V) in3: +4.87 V (min = +4.73 V, max = +5.24 V) ALARM in4: +12.16 V (min = +11.37 V, max = +12.59 V) in5: -11.96 V (min = -12.57 V, max = -11.35 V) in6: -4.86 V (min = -5.25 V, max = -4.74 V) fan2: 3688 RPM (min = 3245 RPM, div = 2) temp1: +29 C (high = +35 C, hyst = +30 C) temp2: -128.0 C (high = +0 C, hyst = +0 C) vid: +2.050 V
alarms:beep_enable:
Sound alarm disabled
</SHELL>
Quoted 10 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Sunday, September 12, 2004 04:46
Subject: Re: Support DB Entry 1770Most (if not all) of the docs in the
lm_sensors2CVS repository are targeted at 2.4 kernels. The reason is both historical (obviously) and technical (2.6 drivers are not part of the package).
Ahh, guess I found it confusing, as the source is in the 2.6 tree. I assumed it was all part of the same project. Written by the same folks, but not part of the LM Sensors project? Or is it a 2.4 module being compiled for a 2.6 kernel?
Quoted 2 lines
But I agree that updating the docs as time permits would be great. Another approach would be to add chip documentation to the 2.6 kernel.
Either do one and make the other point to the first, or do both. Whichever is possible or practical. I am not very familiar with the LM Sensors project, or with the kernel project from the point of view of a patch submitter. So sorry for any confusion.
Quoted 2 lines
Care to provide this documentation update as a patch we could apply to the CVS repository? Thanks.
I'll do that, rewording and including your corrections.
Quoted 2 lines
(BTW, I cannot possibly connect to the CVS repository for now, so someone else will have to apply the patch.)
As long as it gets there eventually. :p
Quoted 1 line
As for me, I will propose my extra-debug patch (slightly cleaned up)
for
Quoted 2 lines
inclusion into the 2.6 kernel. It helped us once, so it could prove to be valuable in the future as well.
I've applied that patch to my debian 2.6.8-5 source (noticed your was 2.6.9-rc1), and generated a new diff, and diffed the diffs, and line numbers were off by one, but there was no stray code... so I assumed it was a clean enough patch. I've compiled with this, and seems to be working fine. The key point was for me to disable "Dalayed Transactions" between ISA<->PCI.
I should test LM Sensors on my other systems as I get a chance: ASUS K7V-T, ASUS A7N8X-Deluxe. My P5A was rev 1.03, and I also have rev 1.04 and 1.06. I also have K7V, and A7N8X boards, and may test them if I don't sell them first. These should all be very similar to my active system boards though.
Leif
BTW Thanks a lot for the support!
Quoted 8 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Friday, September 10, 2004 10:20
Subject: Re: Support DB Entry 1770
Quoted 6 lines
On Fri, 10 Sep 2004 08:44:35 -0400, Leif W wrote
Quoted 2 lines
In "sensors.conf" I have tried 'chip "w83781d-*"' and 'chip "w83781d-isa-*"', but running "sensors" says "No sensors found!".
It shouldn't make any difference, both should work equally well (for
the ISA
Quoted 1 line
mode). However, note that the existence of these sections in the
configuration
Quoted 1 line
file is completely unrelated to the fact that "sensors" will find it
or not.
Ok, I tried with an empty conf file, and see the same information, but not labelled, computed or ignored. So if I mislabel something in the config such that a matching chip or adapter is not found, sensors (sensord, libsensors, etc.) will just display the raw data. sensors.conf is more of an output format specifier, not a device access configuration. Understood.
Quoted 7 lines
Quoted 1 line
Loaded modules are: w83781d,
i2c_sensor,i2c_isa,i2c_core.Sounds OK.
Quoted 1 line
I also tried with
i2c_devloaded, same result.No surprise. i2c-dev is meant for raw access to the busses from user
space.
Quoted 1 line
i2cdetect and i2cdump use it, but "sensors" doesn't (reads from
procfs/sysfs
Quoted 1 line
instead).
The procfs entries do not appear (maybe applied only to kernel 2.4), and the sysfs entries are (I think, I can't remember) in a different location than documented. For me it's /sys/bus/i2c .
Quoted 3 lines
Quoted 1 line
Do I need to reboot when switching between SMBus and ISA?
No. This is Linux. You usually don't reboot unless upgrading kernels.
I know... But the thing is, the SMBus locks up and requires not only a reboot, but a full power cycle. Luckily it does not further require a complete cycle of the ATX power supply (by switch on PS, or unplug/replug).
Windows does require a reboot at least once a week (if you can make it that long w/o crashing). ;-) With the frequent updates to Linux kernel, and other software requiring a reboot such as init, or (suggested) sshd, it seems to be about every 2-4 weeks (barring configuration periods such as this, where it can be several times a day until it's working satisfactorily). Regardless, for me, uptimes are less important than updates, until a hot-swappable kernel is ready. :-)
I started using Unix (DEC Ultrix at college), and DOS 5/Win 3.x 11 years ago, and started using Linux 7.5 years ago. :-) I just never seemed to bother with sensors until I recently lost some 7200 RPM IDE drives due to heat, despite excessive usage of fans. Now I'd like my systems to power off within a few seconds, and stay off until I am there, though it would be cool if I could set the "power-up" BIOS options from within Linux, after an adequate cool-down time or cooler time of day.
Quoted 1 line
I suspect some resource conflict. The w83781d driver will attempt to
reserve
Quoted 1 line
the ISA I/0 range 0x290-0x297. I suspect that it failed to do so.
Please make
Quoted 1 line
sure that your kernel was compiled with i2c debugging enabled.
Ok, reconfigured and recompiled with I2C Core debugging, I2C Algorithm debugging, I2C Bus debugging and I2C Chip debugging enabled.
Quoted 1 line
Then try loading i2c-isa
Abbreviated identical messages reported in multiple logfiles with regexp-like (log_1|log_b) notation and removed empty prompts between command and tail output.
TAIL command: tail -f /var/log/messages /var/log/syslog /var/log/debug /var/log/dmesg &
<defiant> [2004-09-10@10:51:19] ~ -> modprobe i2c-isa
=> /var/log/(debug|syslog) <=
Sep 10 10:51:33 defiant kernel: i2c_adapter i2c-0: registered as adapter
#0
Preloads i2c_core dependency.
<defiant> [2004-09-10@10:52:30] ~ -> lsmod
Module Size Used by i2c_isa 1600 0 i2c_core 20560 1 i2c_isa
Quoted 2 lines
and w83781d, in this order, and watch the logs (
/var/log/syslog,/var/log/debugand dmesg) for hints. I'd expect to
see the
Quoted 1 line
w83781d driver complain it failed to reserve the I/O range.
<defiant> [2004-09-10@10:52:31] ~ -> modprobe w83781d
=> /var/log/(debug|syslog) <=
Sep 10 10:55:40 defiant kernel: i2c-core: driver w83781d registered. Sep 10 10:55:40 defiant kernel: i2c_adapter i2c-0: found normal isa
entry for adapter 9191, addr 0290
I see no complaints?
<defiant> [2004-09-10@10:55:47] ~ -> sensors
No sensors found!
Quoted 2 lines
You may look in
/proc/ioportsto see who/what reserved it. I wouldn't be surprised if
ACPI or
Quoted 1 line
PNP drivers were involved. You may try to enable/disable ACPI and/or
PNP while
Quoted 1 line
configuring your kernel and see if it helps.
I see nothing listed (see "cat /proc/ioports" below) for 0290, nor any range which includes 0290, which is odd, because the modprobe of w83781d found an ISA entry. I seem to have both ACPI and ISA PnP in use. ACPI lets me use the PowerNow! frequency scaling of the AMD K6-(2|III)+ (aka K6-plus) processors. I can disable ACPI for testing, and could probably live without it, but would like to use it if at all possible.
In the system I have two ISA cards: SB AWE 32 PnP (sound card) and US Robotics 56k D/V/F modem. Neither modules are currently loaded, but sound was loaded before the sensors.
Now compiling and testing results with multiple configurations of the kernel with related components in parenthesis:
1) I2C (sensors), ACPI (CPUFreq), ISA PnP (sound, modem)
2) I2C (sensors), ACPI (CPUFreq)
3) I2C (sensors), ISA PnP (sound, modem)
4) I2C (sensors)
Hmm, no joy with #1 or #4, even with all PM disabled (in BIOS as well), all sound disabled, all PNP disabled (in BIOS as well). #2 and #3 untested.
I'd like to use the sound card so I can play sounds triggered by non-fatal sensor alarms. I'd set up my own software (Perl at first, maybe PHP or C later) to maintain an alarm structure with states ok, warn and crit, where warn emails and plays audio file of any format, and crit powers downall results stored in MySQL database. States composed of any combination of the actual sensor reading, and the sensor readings of other devices. A case fan may fail, yet the system may stay cool
enough: warn (email, sounds), unless the case temperature or CPU is also
warn: crit (shutdown).
Eventually I'd like to play with the modem for telecom tinkering (answering machine, single and multi user voice mail, voice menu system, fax send and recv). Both can be completely removed from the system for testing if needed, though I'd rather avoid that if possible. Sound can readily be replaced with a PCI card as I have a few on hand that are well supported by the kernel and ALSA. I have no PCI or external modems.
I am already using two PCI slots for network cards (gateway/NAT/MASQ/etc.). With only 4 slots (and sometimes 5: 1 shared with ISA), I'd like to use these two cards in the two ISA slots, so I don't have to buy any new PCI or external modem (if it can be found anymore) and reserve the free PCI slots (in case the AGP card dies and I need to use a PCI card temporarily), or if I want to add a hard disk expansion card, or some other card.
<defiant> [2004-09-10@10:58:21] ~ -> cat /proc/ioports 0000-001f : dma1
0020-0021 : pic1
0040-005f : timer
0060-006f : keyboard
0070-0077 : rtc
0080-008f : dma page reg
00a0-00a1 : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
01f0-01f7 : ide0
0213-0213 : ISAPnP
0376-0376 : ide1
03c0-03df : vga+
03f6-03f6 : ide0
0a79-0a79 : isapnp write
0cf8-0cff : PCI conf1
5c20-5c3f : 0000:00:03.0
b000-b00f : 0000:00:0f.0
b000-b007 : ide0
b008-b00f : ide1
b400-b47f : 0000:00:0b.0
b400-b47f : 0000:00:0b.0
b800-b8ff : 0000:00:0a.0
b800-b8ff : 8139too
d000-dfff : PCI Bus #01
d800-d8ff : 0000:01:00.0
ec08-ec0b : ACPI timer
ec10-ec15 : ACPI CPU throttle
fff0-ffff : PowerNow!
Quoted 4 lines
Quoted 2 lines
sensors.conf contains only this text (excluding the END comment below):
No END comment as far as I can see...
Oops, rearranged the text so that the file was the last thing, and so removed the comment, but forgot to remove that reference. :-) There was no missing data.
Another odd note that I forgot. sensors-detect seems to insist on checking for i2c-ali1535 module, though this is definitely the ALi 1543 chip. Out of curiousity I configured, compiled and loaded the ali1535 module, and sensors-detect found nothing for that. Is this one of those situations where boards used either chipset? I know specifically for the ASUS P5A board, that it did not use the ALi 1535 chip. Is there a way to detect which chip is present, and not bug about the other?
Leif
Quoted 3 lines
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
Quoted 11 lines
----- Original Message -----
From: "Jean Delvare" <[email protected]>
To: "Leif W" <[email protected]>
Cc: <[email protected]>
Sent: Friday, September 10, 2004 17:15
Subject: Re: Support DB Entry 1770I took a look at the driver, trying to figure out where it thinks your chip should not be used. Please apply the attached patch and recompile the driver, then repeat the tests. Hopefully this will yield more information.
i2c-isa loads fine. w83781d fails at step 2.
=> /var/log/syslog <=
Sep 10 19:15:10 defiant kernel: i2c_adapter i2c-0: registered as adapter
#0
<defiant> [2004-09-10@19:15:17] ~ -> modprobe w83781d
=> /var/log/syslog <=
Sep 10 19:15:25 defiant kernel: i2c-core: driver w83781d registered. Sep 10 19:15:25 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 10 19:15:25 defiant kernel: i2c_adapter i2c-0: Detection of w83781d
chip failed at step 2
Quoted 1 line
I would also appreciate the output of "isadump
0x2950x296".
Here's the output before I loaded any modules.
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 20: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 30: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 40: 01 d8 0f ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c 50: 00 7f 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff 60: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 70: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
a0: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
b0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
c0: 01 00 00 ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c
d0: 01 75 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff
e0: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
f0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
Here's the output after I loaded i2c-isa and w83781d.
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 20: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 30: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 40: 01 c8 0f ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c 50: 02 56 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff 60: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 70: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
a0: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
b0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
c0: 01 00 00 ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c
d0: 03 45 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff
e0: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
f0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
I tried another isadump later and diff'ed the results and some lines were different. I guess it's constantly changing? This is the sensor data?
Leif
On Fri, 10 Sep 2004 08:44:35 -0400, Leif W wrote
Quoted 6 lines
Ticket # 1770
Hi,
I couldn't find a way to reply via the support ticket page. The problem was not solved on my end.
This is a weakness of our home-brew ticket system. We certainly should switch to a more modern system such as Bugzilla.
Quoted 4 lines
"sensors-detect" did in fact discover the W83781D device when probing the ISA bus, at
0x290as you mentioned. I missed it before, but noticed it when I did not load the ali15x3 adapter driver, and scanned the ISA bus.
OK, interesting information. This raises some hope that you should be able to get it to work over the ISA bus in the end.
Quoted 2 lines
In "sensors.conf" I have tried 'chip "w83781d-*"' and 'chip "w83781d-isa-*"', but running "sensors" says "No sensors found!".
It shouldn't make any difference, both should work equally well (for the ISA mode). However, note that the existence of these sections in the configuration file is completely unrelated to the fact that "sensors" will find it or not.
Quoted 1 line
Loaded modules are: w83781d,
i2c_sensor,i2c_isa,i2c_core.
Sounds OK.
Quoted 1 line
I also tried with
i2c_devloaded, same result.
No surprise. i2c-dev is meant for raw access to the busses from user space. i2cdetect and i2cdump use it, but "sensors" doesn't (reads from procfs/sysfs instead).
Quoted 1 line
Am I missing a module or module option?
No, it should work the way you did.
Quoted 2 lines
Is it possible that the chip is detected on the ISA bus but not accessible (misconfigured?) or not wired (unlikely?).
It is wired and configured properly, or sensors-detect wouldn't see it.
Quoted 1 line
Do I need to reboot when switching between SMBus and ISA?
No. This is Linux. You usually don't reboot unless upgrading kernels.
Quoted 5 lines
If I wanted to use ISA but still see the EEPROMs, would I still hang the bus? Would I load both the ali15x3 and isa adapter drivers? How would I configure sensors.conf? With separate "w83781d-i2c-*" and "w83781d-isa-*" sections, with ALL "w83781d-i2c-*" values ignored with optionally commented label, compute and set?
This is a second problem we will work on later. For now, the problem is to understand why you plain can't get the ISA W83781D to work.
I suspect some resource conflict. The w83781d driver will attempt to reserve the ISA I/0 range 0x290-0x297. I suspect that it failed to do so. Please make sure that your kernel was compiled with i2c debugging enabled. Then try loading i2c-isa and w83781d, in this order, and watch the logs (/var/log/syslog, /var/log/debug and dmesg) for hints. I'd expect to see the w83781d driver complain it failed to reserve the I/O range. You may look in /proc/ioports to see who/what reserved it. I wouldn't be surprised if ACPI or PNP drivers were involved. You may try to enable/disable ACPI and/or PNP while configuring your kernel and see if it helps.
Quoted 2 lines
sensors.conf contains only this text (excluding the END comment below):
No END comment as far as I can see...
Signature · 2 lines
Jean Delvare http://khali.linux-fr.org/
Quoted 6 lines
=> /var/log/(debug|syslog) <=
Sep 10 10:55:40 defiant kernel: i2c-core: driver w83781d registered. Sep 10 10:55:40 defiant kernel: i2c_adapter i2c-0: found normal isaentry for adapter 9191, addr 0290
I see no complaints?
Looks good, I have to admit.
I took a look at the driver, trying to figure out where it thinks your chip should not be used. Please apply the attached patch and recompile the driver, then repeat the tests. Hopefully this will yield more information.
I would also appreciate the output of "isadump 0x295 0x296".
Quoted 8 lines
Another odd note that I forgot. sensors-detect seems to insist on checking for i2c-ali1535 module, though this is definitely the ALi 1543 chip. Out of curiousity I configured, compiled and loaded the ali1535 module, and sensors-detect found nothing for that. Is this one of those situations where boards used either chipset? I know specifically for the ASUS P5A board, that it did not use the ALi 1535 chip. Is there a way to detect which chip is present, and not bug about the other?
The bug is with ALi giving the same PCI ID to both chips. This makes them virtually undistinguishable, thus the trouble in sensors-detect. I am not a specialist of ALi chips but I don't think anything can be done, at least not easily. The only chance of the average user is to try both and see what works.
Thanks.
Signature · 84 lines
Jean "Khali" Delvare
http://khali.linux-fr.org/
-------------- next part --------------
--- linux-2.6.8/drivers/i2c/chips/w83781d.c.orig 2004-08-24 18:42:40.000000000 +0200
+++ linux-2.6.8/drivers/i2c/chips/w83781d.c 2004-09-10 23:05:42.000000000 +0200
@@ -1064,6 +1064,9 @@
if (is_isa)
if (!request_region(address, W83781D_EXTENT, "w83781d")) {
err = -EBUSY;
+ dev_dbg(&adapter->dev, "Request of region "
+ "0x%x-0x%x for w83781d failed\n", address,
+ address + W83781D_EXTENT - 1);
goto ERROR0;
}
@@ -1076,16 +1079,12 @@
/* We need the timeouts for at least some LM78-like
chips. But only if we read 'undefined' registers. */
i = inb_p(address + 1);
- if (inb_p(address + 2) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 3) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 7) != i) {
+ if (inb_p(address + 2) != i
+ || inb_p(address + 3) != i
+ || inb_p(address + 7) != i) {
err = -ENODEV;
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 1\n");
goto ERROR1;
}
#undef REALLY_SLOW_IO
@@ -1096,6 +1095,8 @@
if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) {
outb_p(i, address + 5);
err = -ENODEV;
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 2\n");
goto ERROR1;
}
}
@@ -1126,8 +1127,10 @@
force_*=... parameter, and the Winbond will be reset to the right
bank. */
if (kind < 0) {
- if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80){
+ if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "3\n");
goto ERROR2;
}
val1 = w83781d_read_value(new_client, W83781D_REG_BANK);
@@ -1137,6 +1140,8 @@
(((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
|| ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "4\n");
goto ERROR2;
}
/* If Winbond SMBus, check address at 0x48.
@@ -1146,6 +1151,8 @@
if (w83781d_read_value
(new_client, W83781D_REG_I2C_ADDR) != address) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed "
+ "at step 5\n");
goto ERROR2;
}
}
@@ -1168,6 +1175,8 @@
vendid = asus;
else {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Chip was made by neither "
+ "Winbond nor Asus?\n");
goto ERROR2;
}Quoted 7 lines
i2c-isa loads fine. w83781d fails at step 2.
=>
/var/log/syslog<=Sep 10 19:15:10 defiant kernel: i2c_adapter i2c-0: registered asadapter
#0
Quoted 8 lines
<defiant> [2004-09-10@19:15:17] ~ -> modprobe w83781d
=>
/var/log/syslog<=Sep 10 19:15:25 defiant kernel: i2c-core: driver w83781d registered. Sep 10 19:15:25 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 10 19:15:25 defiant kernel: i2c_adapter i2c-0: Detection ofw83781d chip failed at step 2
OK, at least we now know where it breaks. The strange thing is that the very same detection trick is used in sensors-detect, where it seems to work fine for you. I admit I don't quite understand what's going on.
Attached is a modified patch that will make the failure more verbose. Please revert the previous patch, apply this one, and test again.
The patch will also ignore the step 2 error, so that we can see whether or not this is the only step failing.
Alternatively, you can try to load the w83781d module with the "force‘91,0x290" parameter and see how it goes. This should skip all the detection steps.
Quoted 42 lines
Quoted 1 line
I would also appreciate the output of "isadump
0x2950x296".Here's the output before I loaded any modules.
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 20: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 30: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 40: 01 d8 0f ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c 50: 00 7f 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff 60: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 70: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
a0: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
b0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
c0: 01 00 00 ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c
d0: 01 75 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff
e0: 7e 7d de b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
f0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00Here's the output after I loaded i2c-isa and w83781d.
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 20: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 30: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 40: 01 c8 0f ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c 50: 02 56 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff 60: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed 70: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
a0: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
b0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
c0: 01 00 00 ff 7f 00 40 a0 2d 01 01 40 01 95 80 5c
d0: 03 45 80 ff ff ff 00 80 11 ff ff ff ff ff ff ff
e0: 7d 7d df b5 c7 d7 ca 1c ff 5c ff ff 00 ff 00 ed
f0: b0 80 24 00 c2 08 24 00 00 c0 a1 00 20 06 00 00
Quoted 3 lines
I tried another isadump later and diff'ed the results and some lines were different. I guess it's constantly changing? This is the sensor data?
True. Registers containing measured values are likely to change, not by much but very often. Nothing to be afraid of. You can also notice that the chip registers are addressed over 7 bits, not 8. Thus 0x00-0x7F and 0x80-0xFF are "the same" (modulo the changes in measured values).
Signature · 93 lines
Jean "Khali" Delvare
http://khali.linux-fr.org/
-------------- next part --------------
--- linux-2.6.8/drivers/i2c/chips/w83781d.c.orig 2004-08-24 18:42:40.000000000 +0200
+++ linux-2.6.8/drivers/i2c/chips/w83781d.c 2004-09-11 09:08:34.000000000 +0200
@@ -1064,6 +1064,9 @@
if (is_isa)
if (!request_region(address, W83781D_EXTENT, "w83781d")) {
err = -EBUSY;
+ dev_dbg(&adapter->dev, "Request of region "
+ "0x%x-0x%x for w83781d failed\n", address,
+ address + W83781D_EXTENT - 1);
goto ERROR0;
}
@@ -1076,16 +1079,12 @@
/* We need the timeouts for at least some LM78-like
chips. But only if we read 'undefined' registers. */
i = inb_p(address + 1);
- if (inb_p(address + 2) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 3) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 7) != i) {
+ if (inb_p(address + 2) != i
+ || inb_p(address + 3) != i
+ || inb_p(address + 7) != i) {
err = -ENODEV;
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 1\n");
goto ERROR1;
}
#undef REALLY_SLOW_IO
@@ -1093,10 +1092,14 @@
/* Let's just hope nothing breaks here */
i = inb_p(address + 5) & 0x7f;
outb_p(~i & 0x7f, address + 5);
- if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) {
+ val2 = inb_p(address + 5) & 0x7f;
+ if (val2 != (~i & 0x7f)) {
outb_p(i, address + 5);
- err = -ENODEV;
- goto ERROR1;
+ /* err = -ENODEV; */
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 2 (0x%x != "
+ "0x%x)\n", val2, ~i & 0x7f);
+ /* goto ERROR1;*/
}
}
}
@@ -1126,8 +1129,10 @@
force_*=... parameter, and the Winbond will be reset to the right
bank. */
if (kind < 0) {
- if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80){
+ if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "3\n");
goto ERROR2;
}
val1 = w83781d_read_value(new_client, W83781D_REG_BANK);
@@ -1137,6 +1142,8 @@
(((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
|| ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "4\n");
goto ERROR2;
}
/* If Winbond SMBus, check address at 0x48.
@@ -1146,6 +1153,8 @@
if (w83781d_read_value
(new_client, W83781D_REG_I2C_ADDR) != address) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed "
+ "at step 5\n");
goto ERROR2;
}
}
@@ -1168,6 +1177,8 @@
vendid = asus;
else {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Chip was made by neither "
+ "Winbond nor Asus?\n");
goto ERROR2;
}Quoted 8 lines
<defiant> [2004-09-11@13:54:07] ~ -> modprobe w83781d
=>
/var/log/syslog<=Sep 11 13:54:10 defiant kernel: i2c-core: driver w83781d registered. Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 11 13:54:10 defiant kernel: i2c_adapter i2c-0: Detection ofw83781d chip failed at step 2 (
0x61!=0x60)
Odd. I wonder how this is even possible. What's more, I made the error on-fatal so I would have expected some more messages after that. No extra message means that either a critical failure occured (out of memory or similar), or the end of the detection was fine - but then why would sensors not show the chip?
An even more verbose patch is attached, please try.
Quoted 6 lines
Quoted 3 lines
Alternatively, you can try to load the w83781d module with the "force‘91,0x290" parameter and see how it goes. This should skip all the detection steps.
Tried this, "sensors" still says "No sensors found!" First two syslog lines are same as above, minus the third "failed" line.
Please double-check. The second line should read "found force parameter" instead of "found normal isa entry". If it doesn't, this would mean that the driver didn't understand your request. Either you didn't formulate it correctly, or this has to be another bug in the i2c subsystem.
Thanks.
Signature · 123 lines
Jean "Khali" Delvare
http://khali.linux-fr.org/
-------------- next part --------------
--- linux-2.6.8/drivers/i2c/chips/w83781d.c.orig 2004-08-24 18:42:40.000000000 +0200
+++ linux-2.6.8/drivers/i2c/chips/w83781d.c 2004-09-11 21:30:51.000000000 +0200
@@ -1064,6 +1064,9 @@
if (is_isa)
if (!request_region(address, W83781D_EXTENT, "w83781d")) {
err = -EBUSY;
+ dev_dbg(&adapter->dev, "Request of region "
+ "0x%x-0x%x for w83781d failed\n", address,
+ address + W83781D_EXTENT - 1);
goto ERROR0;
}
@@ -1076,16 +1079,12 @@
/* We need the timeouts for at least some LM78-like
chips. But only if we read 'undefined' registers. */
i = inb_p(address + 1);
- if (inb_p(address + 2) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 3) != i) {
- err = -ENODEV;
- goto ERROR1;
- }
- if (inb_p(address + 7) != i) {
+ if (inb_p(address + 2) != i
+ || inb_p(address + 3) != i
+ || inb_p(address + 7) != i) {
err = -ENODEV;
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 1\n");
goto ERROR1;
}
#undef REALLY_SLOW_IO
@@ -1093,10 +1092,15 @@
/* Let's just hope nothing breaks here */
i = inb_p(address + 5) & 0x7f;
outb_p(~i & 0x7f, address + 5);
- if ((inb_p(address + 5) & 0x7f) != (~i & 0x7f)) {
+ val2 = inb_p(address + 5) & 0x7f;
+ if (val2 != (~i & 0x7f)) {
outb_p(i, address + 5);
- err = -ENODEV;
- goto ERROR1;
+ dev_dbg(&adapter->dev, "Detection of w83781d "
+ "chip failed at step 2 (0x%x != "
+ "0x%x at 0x%x)\n", val2, ~i & 0x7f,
+ address + 5);
+ /* err = -ENODEV;
+ goto ERROR1; */
}
}
}
@@ -1106,6 +1110,7 @@
But it allows us to access w83781d_{read,write}_value. */
if (!(data = kmalloc(sizeof(struct w83781d_data), GFP_KERNEL))) {
+ dev_dbg(&adapter->dev, "Not enough memory for w83781d\n");
err = -ENOMEM;
goto ERROR1;
}
@@ -1126,8 +1131,10 @@
force_*=... parameter, and the Winbond will be reset to the right
bank. */
if (kind < 0) {
- if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80){
+ if (w83781d_read_value(new_client, W83781D_REG_CONFIG) & 0x80) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "3\n");
goto ERROR2;
}
val1 = w83781d_read_value(new_client, W83781D_REG_BANK);
@@ -1137,6 +1144,8 @@
(((!(val1 & 0x80)) && (val2 != 0xa3) && (val2 != 0xc3))
|| ((val1 & 0x80) && (val2 != 0x5c) && (val2 != 0x12)))) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed at step "
+ "4\n");
goto ERROR2;
}
/* If Winbond SMBus, check address at 0x48.
@@ -1146,6 +1155,8 @@
if (w83781d_read_value
(new_client, W83781D_REG_I2C_ADDR) != address) {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Detection failed "
+ "at step 5\n");
goto ERROR2;
}
}
@@ -1168,6 +1179,8 @@
vendid = asus;
else {
err = -ENODEV;
+ dev_dbg(&new_client->dev, "Chip was made by neither "
+ "Winbond nor Asus?\n");
goto ERROR2;
}
@@ -1221,8 +1234,10 @@
init_MUTEX(&data->update_lock);
/* Tell the I2C layer a new client has arrived */
- if ((err = i2c_attach_client(new_client)))
+ if ((err = i2c_attach_client(new_client))) {
+ dev_dbg(&new_client->dev, "Attach failed\n");
goto ERROR2;
+ }
/* attach secondary i2c lm75-like clients */
if (!is_isa) {
@@ -1309,6 +1324,7 @@
}
#endif
+ dev_dbg(&new_client->dev, "Detect OK\n");
return 0;
ERROR3:Quoted 6 lines
=>
/var/log/syslog<=Sep 11 19:27:45 defiant kernel: i2c-core: driver w83781d registered. Sep 11 19:27:45 defiant kernel: i2c_adapter i2c-0: found normal isa entry for adapter 9191, addr 0290 Sep 11 19:27:45 defiant kernel: i2c_adapter i2c-0: Detection ofw83781d chip failed at step 2 (
0x61!=0x60at0x295)
Still the same values (which technically correspond to register addresses). I checked the datasheets and it happens that these regiesters belong to a so-called "auto-increment" range. This basically means that reading any register in this range will automatically increase the address pointer, those value we are reading from I/O address 0x295.
I think I am now starting to understand what's going on. Something else is trying to access the chip at the very moment we are, most probably the BIOS. Why it does, I don't know. I thought that Asus started to implement such silly behaviors only recently, but it seems not. The SMBus locks you were experiencing speak for themselves.
So, first of all, I have to tell you know that you should expect problems if you go on with using the w83781d driver on your system. It is likely that from times to times some readings will be completely wrong (BIOS reads interfering with yours). You could also experiment random reboots/halts (your reads interfering with the BIOSes).
Why the sensors-detect script doesn't seem to be affected is above me. It didn't fail to detect the chip once, did it?
Quoted 19 lines
Ok, I see the "found force" in
"/var/log/syslog" and "/var/log/debug". But there's "Ignoring 'force'" in "/var/log/syslog" and "/var/log/messages". It is looking on adapter 0 not 9191 as I specified. And "sensors" reports "No sensors found!".<SHELL>
<defiant> [2004-09-11@15:45:02] ~ -> modprobe w83781d force‘91,0x290
=>
/var/log/syslog<=Sep 11 15:45:30 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:45:30 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:45:30 defiant kernel: : Ignoring 'force' parameter forunknown chip atadapter 0, address
0x290=>
/var/log/messages<=Sep 11 15:45:30 defiant kernel: : Ignoring 'force' parameter for
Quoted 8 lines
unknown chip atadapter 0, address
0x290=>
/var/log/debug<=Sep 11 15:45:30 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:45:30 defiant kernel: i2c_adapter i2c-0: found forceparameter for adapter 9191, addr 0290
</SHELL>
Oh, OK, I see it now. I completely missed that exit point. This is where the detection fails from the beginning. It only complains (in the form of a log message) when forced. I missed that detail so far, sorry.
Quoted 3 lines
The option below is the only one that seems to get this to work, and it appears to work fine when forced (i.e. "sensors" reports correct data).
Yeah, forcing will skip detection and optionally identification as well.
Quoted 39 lines
<SHELL>
<defiant> [2004-09-11@15:50:42] ~ -> modprobe w83781d force_w83781d‘91,0x290
<defiant> [2004-09-11@15:50:48] ~ ->
=>/var/log/syslog<=Sep 11 15:50:48 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: client [w83781d] registered to adapter Sep 11 15:50:48 defiant kernel: registering 0-0290=>
/var/log/debug<=Sep 11 15:50:48 defiant kernel: i2c-core: driver w83781d registered. Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: found force parameter for adapter 9191, addr 0290 Sep 11 15:50:48 defiant kernel: i2c_adapter i2c-0: client [w83781d] registered to adapter Sep 11 15:50:48 defiant kernel: registering 0-0290<defiant> [2004-09-11@15:50:52] ~ -> sensors
w83781d-isa-0290Adapter: ISA adapter VCore 1: +2.00 V (min = +0.00 V, max = +4.08 V) ALARM VCore 2: +2.00 V (min = +0.00 V, max = +4.08 V) ALARM +3.3V: +3.57 V (min = +2.82 V, max = +3.79 V) ALARM +5V: +4.87 V (min = +0.97 V, max = +3.44 V) ALARM +12V: +12.10 V (min = +11.80 V, max = +0.00 V) -12V: -12.02 V (min = -0.45 V, max = -2.00 V) -5V: -4.89 V (min = -0.00 V, max = -0.00 V) CPU Fan: 3708 RPM (min = 21093 RPM, div = 2) M/B Temp: +29 C (high = -64 C, hyst = -95 C) CPU Temp: +0.0 C (high = +0 C, hyst = +0 C)vid: +3.500 V
alarms:beep_enable:
Sound alarm disabled
Quoted 8 lines
<defiant> [2004-09-11@15:50:54] ~ ->
=>/var/log/syslog<=Sep 11 15:50:54 defiant kernel: Starting device update=>
/var/log/debug<=Sep 11 15:50:54 defiant kernel: Starting device update</SHELL>
Readings look rather good except CPU Temp. Limits look completely broken though.
From other post:
Quoted 3 lines
Actually, the data "appears" to be read correctly but temp2 is not correct. Also an ALARM where there should be none (in3). A result of forcing?
This is just a guess, but the problem with temp2 could be caused by the BIOS concurent accesses.
The ALARM bits stay up until read, so you can usually see them once after the cause has disappeared. This is by chip design. If it does not disappear after one more read, then there is something wrong (possibly the BIOS breaking things when reading in our back again.
You may want to check in the BIOS setup screen if there is some option to disable "active hardware monitoring" or whatever they called that. You may also want to upgrade BIOSes and see if it helps.
I will update the ticket in the sensors ticket DB, thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 4 lines
Got it working with "modprobe w83781d force_w83781d‘91,0x290". I guess the "force" alone tried something different. Not sure if this problem is solvable. If it is, great. If not, the workaround as explained in the docs could be further elaborated.
"force" skips detection (basically checking if there is a chip at 0x290 or not) while force_w83781d additionally skips identification (basically checking if the chip is a Winbond W83781D or not). Both steps are failing for you, probably for the same reason (BIOS messing with the registers).
Quoted 10 lines
It's mentioned in the docs (
http://www2.lm-sensors.nu/~lm78/cvs/lm_sensors2/doc/chips/w83781d ) that the chip gets misidentified. However my chip was detected, is that the same as identified? Also, the docs says:(modprobe w83781d force_CHIP=BUS,0x2d where CHIP is the chip name and BUS is your i2c bus number -
cat/proc/bus/i2cto see a list of bus numbers)But I have no
/proc/bus/i2c(file or directory).
This is for 2.4 kernels.
Quoted 3 lines
I can't find the
corresponding data in /sys , either because I don't know where to look, or it's just not there.
There is no file in /sys. Instead you can use "i2cdetect -l" (which happens to also work for 2.4 kernels).
Quoted 2 lines
I suggest an update to add a note
explaining how to get the right bus number in kernel 2.4 and 2.6.
Most (if not all) of the docs in the lm_sensors2 CVS repository are targeted at 2.4 kernels. The reason is both historical (obviously) and technical (2.6 drivers are not part of the package).
But I agree that updating the docs as time permits would be great. Another approach would be to add chip documentation to the 2.6 kernel.
Quoted 23 lines
Additionally make a clearer distinction between ISA bus/address and I2C bus/address and list typical numbers for this device: ISA bus 9191 / address
0x290and I2C bus 0 or 1 / address0x2d. Also helpful would be both the modprobe syntax (as shown) and the modules.conf syntax.# Mail client won't let me enter tabs.
<
DOC_begin>W8378* PROBLEMS
-----------------
Known problems:
- Some chips are misidentified even if successfully detected. This is caused by the chip having the wrong WCHIPID register value, so there is no fix. The workaround is to use theforce_CHIPparameter.modprobe format:
modprobe w83781d force_CHIP=BUS,ADDR
modules.conf format:
Quoted 7 lines
options w83781d force_CHIP=BUS,ADDR
Example values, comma separated, use only one, use only ISA or I2C:
CHIP : w83781d
I2C BUS : 0, 1
This can be about any value, depending on the other devices in the system. On my system, the hardware monitoring bus is 4 (0 to 3 are occupied by my Radeon graphics adapter).
Quoted 10 lines
I2C ADDR: 0x2d
ISA BUS : 9191
ISA ADDR: 0x290
Find your specific bus:
kernel 2.4 I2C: cat /proc/bus/i2c
kernel 2.4 ISA: ???
kernel 2.6 I2C: ???
kernel 2.6 ISA: ???Irrelevant for ISA, bus is always 9191.
For 2.6 I2C, "i2cdetect -l" (which also works for 2.4).
Quoted 6 lines
Find your specific address:
kernel 2.4 I2C: ???
kernel 2.4 ISA: ???
kernel 2.6 I2C: ???
kernel 2.6 ISA: ???Always 0x290 for ISA, there is no way to detect it if a different value is.
For I2C, "i2cdetect <BUS NUMBER>" should help, although I never saw a W83781D at a non-0x2d address.
Quoted 4 lines
See "Addresses scanned" sections under "Supported chips" above.
</DOC_end>
Care to provide this documentation update as a patch we could apply to the CVS repository? Thanks.
(BTW, I cannot possibly connect to the CVS repository for now, so someone else will have to apply the patch.)
As for me, I will propose my extra-debug patch (slightly cleaned up) for inclusion into the 2.6 kernel. It helped us once, so it could prove to be valuable in the future as well.
Thanks again.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 7 lines
Quoted 3 lines
Most (if not all) of the docs in the
lm_sensors2CVS repository are targeted at 2.4 kernels. The reason is both historical (obviously) and technical (2.6 drivers are not part of the package).Ahh, guess I found it confusing, as the source is in the 2.6 tree. I assumed it was all part of the same project. Written by the same folks, but not part of the LM Sensors project?
Yes, that's the idea. It may sound confusing at first, but the truth is that kernel code belongs to the kernel tree. Drivers should have been merged into the main Linux tree many months earlier (if not years) but it wasn't as easy as it sounds, thus the delay.
Quoted 1 line
Or is it a 2.4 module being compiled for a 2.6 kernel?
Drivers usually need quite some porting work, although most of it is the same for all drivers.
Quoted 4 lines
Quoted 2 lines
(BTW, I cannot possibly connect to the CVS repository for now, so someone else will have to apply the patch.)
As long as it gets there eventually. :p
Correction, I have access again now. Slow access, but still...
Quoted 2 lines
The key point was for me to disable "Dalayed Transactions" between ISA<->PCI.
Oh, really? You mean like changing settings in the BIOS setup screen? This sure would need to be documented. I can't remember similar cases being reported in the past.
Thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 8 lines
Quoted 4 lines
I thought that Asus
started to implement such silly behaviors only recently, but it seems not. The SMBus locks you were experiencing speak for themselves.:-\ Ahh well, I always thought they did a pretty good job in other regards. Fabrication of the boards was always nice, not sloppy looking like some other boards at the time.
Agreed, I have enjoyed Asus boards too for quite some times, until they started shipping their boards with undocumented proprietary monitoring chips (AS99127F, ASB100...) and implemented really weird "active" hardware monitoring.
Quoted 10 lines
I've got a suggestion for "sensors-detect". Command-line options for the specific tests to perform or skip would be cool, so I could run one command line. Otherwise, I've got to use an input file with my prompt-answers, run a command to take the file as input, run another command to dump STDOUT and STDERR to a file, and run another command to read the output file. For example this is what I'd use for this testing:
sensors-detect --pci-no --isa-yes --superio-no --summary-yes --commands-no
Not sure it would be that useful for the average user. Usually you only run the script once, so you want to detect everything.
A much more interessant improvement IMHO would be a fully automatic mode (non-interactive), simply generating the configuration files without the user having to care. Unfortunatelly, sensors-detect is a very old piece of code and it'll be hard to accomplish such a miracle, especially since it would require motherboard-specific information we don't really have.
Quoted 7 lines
Disabling "Delayed Transaction" seems to fix the problems. in3 has no persistent ALARM, temp2 is read correctly,
temp2_overandtemp2_hystare connect, no chirping. The cost is a performance hit of 50-60 PCI clocks during ISA access (sensors, maybe modem and sound card). Funny they don't clearly state that enabling "Delayed Transaction" will break ISA access to the "Health Monitoring". "sensors" and "sensord" appear to work fine. No force orforce_w83781drequired.
This is VERY interesting and surprising too. I wouldn't have imagined that such a broken behavior could result in "bad" BIOS settings (one may wonder why they propose the option at all if enabling it breaks the box.)
Quoted 2 lines
The only odd looking thing at this point is the "registering" annd "Detect" lines. It reports "0-0290", but should it be 9191-0290?
Interesting question, I can't really tell why it is this way. The bus numbering typically depends on the order in which drivers are inserted. For some reasons, the ISA bus has a kind of alias with the "9191" bus number. I agree this makes thing more confusing than it helps.
Thanks a lot for the details report, I'll update the ticket.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/