Ticket #2306 (closed defect: fixed)

Opened 2 years ago

Last modified 22 months ago

W83781D on ISA detected but not in /sys

Reported by: ticket Owned by: khali
Priority: major Milestone:
Component: kernel Version: kernel
Keywords: i2c-isa, w83781d Cc: mc-sensors@…

Description (last modified by khali) (diff)

Hi all,

after the restructuring and removal of the i2c-isa module in Kernel 2.6.22, my w83781d does not detect the chip on ISA any more. (Hint: The help page still says: What to do if it inserts, but nothing happens? For an ISA sensor chip, did you also modprobe i2c-isa? It must be inserted. )

Are there any special kind of steps to do when switching from <2.6.22 to 2.6.22++? At least I did not find any ...

File outputs follow:

##################

Output sensors-detect (same for 2.6.21.5 and 2.6.24.2):

skynet10:/home/mc# sensors-detect
# sensors-detect revision 5108 (2008-01-22 13:22:47 +0100)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no): YES
Probing for PCI bus adapters...
Use driver `i2c-piix4' for device 0000:00:07.3: Intel 82371AB PIIX4 ACPI

We will now try to load each adapter module in turn.
Module `i2c-piix4' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.

We are now going to do the I2C/SMBus adapter probings. Some chips may
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.

Next adapter: SMBus PIIX4 adapter at 5000 (i2c-0)
Do you want to scan it? (YES/no/selectively): YES
Client found at address 0x50
Handled by driver `eeprom' (already loaded), chip type `eeprom'
    (note: this is probably NOT a sensor chip!)

Some chips are also accessible through the ISA I/O ports. We have to
write to arbitrary I/O ports to probe them. This is usually safe though.
Yes, you do have ISA I/O ports even if you do not have any ISA slots!
Do you want to scan the ISA I/O ports? (YES/no): YES
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' at 0x290...     No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   Success!
    (confidence 8, driver `w83781d')
Probing for `Winbond W83782D' at 0x290...                   No
Probing for `Silicon Integrated Systems SIS5595'...         No
Probing for `VIA VT82C686 Integrated Sensors'...            No
Probing for `VIA VT8231 Integrated Sensors'...              No
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

###########

sensors:
(2.6.21.5):
skynet10:/home/mc# sensors
w83781d-isa-0290
Adapter: ISA adapter
[...usual sensor data...]
(2.6.24.2):
No sensors detected

############

(2.6.21.5)
skynet10:/home/mc# ll /sys/bus/i2c/devices/
total 0
drwxr-xr-x 2 root root 0 Mar  7 13:22 .
drwxr-xr-x 4 root root 0 Mar  7 01:23 ..
lrwxrwxrwx 1 root root 0 Mar  7 13:22 0-0050 -> ../../../devices/pci0000:00/0000:00:07.3/i2c-0/0-0050
lrwxrwxrwx 1 root root 0 Mar  7 13:22 9191-0290 -> ../../../devices/platform/i2c-9191/9191-0290

9191-0290 (from w83871d) is missing in Kernel 2.6.24.2.

Kernel config is identical (except for i2c-isa o.c., which does not exist any more) #################

skynet10:/home/mc# sensors -v
sensors version 3.0.1 with libsensors version 3.0.0

dmesg gives no hints....

#################

Kind regards, Martin

Attachments

hwmon-w83781d-fix-pnp-io-conflict.patch Download (2.5 KB) - added by khali 2 years ago.
Fix resource conflict between w83781d and pnp

Change History

Changed 2 years ago by khali

  • owner changed from somebody to khali
  • status changed from new to assigned
  • component changed from hardware to kernel
  • description modified (diff)
  • milestone 3.0.2 deleted

Changed 2 years ago by khali

It is expected that 9191-0290 is gone with kernel 2.6.22 or later, as i2c-isa no longer exists. Stop looking for your W83781D in /sys/bus/i2c/devices and instead look for it in /sys/class/hwmon. Do you see anything there?

I have an old motherboard with a W83781D, I _hope_ that it is on the ISA bus, if it is I'll try to reproduce the problem there.

Your "sensors -v" output is rather strange, usually the sensors and libsensors versions match. I can't think of any specific fix in libsensors 3.0.1 that would solve your problem, but it is still worth a try, just in case.

Changed 2 years ago by ticket

Updated libsensors to 3.0.1, no change (as you expected).

/sys/class/hwmon is empty /sys/class/i2c-adapter/ only lists eeprom (on SMBus PIIX4)

Kind regards, Martin

Changed 2 years ago by khali

OK, I have my test system running, kernel 2.6.24.2 + lm-sensors 3.0.1, W83781D on ISA, and the w83781d driver works as expected for me.

Please attach the contents of /proc/ioports on 2.6.21.5 and 2.6.24.2. Maybe the resource management changes are having a bad side effect on your machine.

If you have the possibility to build your kernel with CONFIG_HWMON_DEBUG_CHIP, this could help too, I guess you would see in the logs where the w83781d driver chokes.

Changed 2 years ago by ticket

Hi, here are the two dumps.

If I read the Makefile correctly, CONFIG_HWMON_DEBUG_CHIP only sets DEBUG compile flag, which has no effect on w83871d.c, only on w83791d.c I turned quite a bunch of debug flags on, however, I didn't see the actual init messages of w83871d.c. (neither console, kern.log/messages.log/syslog/debug/whatever). Anything special I forgot? Maybe the i2c debug output at the bottom helps anyway.

(2.6.21.5) skynet10:/sys/class# cat /proc/ioports 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : 0000:00:07.1 01f0-01f7 : 0000:00:07.1

01f0-01f7 : ide0

0290-0297 : w83781d-isa 02f8-02ff : serial 0376-0376 : 0000:00:07.1 0378-037a : parport0 03c0-03df : vga+ 03f6-03f6 : 0000:00:07.1

03f6-03f6 : ide0

03f8-03ff : serial 0cf8-0cff : PCI conf1 4000-403f : 0000:00:07.3

4000-4003 : ACPI PM1a_EVT_BLK 4008-400b : ACPI PM_TMR 400c-400f : ACPI GPE0_BLK

4040-4041 : ACPI PM1a_CNT_BLK 5000-500f : 0000:00:07.3

5000-5007 : piix4_smbus

d000-d01f : 0000:00:07.2 d400-d43f : 0000:00:09.0

d400-d43f : eepro100

d800-d8ff : 0000:00:0c.0

d800-d8ff : 8139too

dc00-dc3f : 0000:00:0f.0

dc00-dc3f : ESS Solo-1

e000-e00f : 0000:00:0f.0

e000-e00f : ESS Solo-1

e400-e40f : 0000:00:0f.0

e400-e40f : ESS Solo-1

e800-e803 : 0000:00:0f.0

e800-e803 : ESS Solo-1

ec00-ec03 : 0000:00:0f.0

ec00-ec03 : ESS Solo-1

f000-f00f : 0000:00:07.1

f000-f007 : ide0

(2.6.24.2): skynet10:/home/mc# cat /proc/ioports 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-006f : keyboard 0070-0077 : rtc 0080-008f : dma page reg 00a0-00a1 : pic2 00c0-00df : dma2 00f0-00ff : fpu 0170-0177 : 0000:00:07.1 01f0-01f7 : 0000:00:07.1

01f0-01f7 : ide0

0294-0297 : pnp 00:02 02f8-02ff : serial 0376-0376 : 0000:00:07.1 0378-037a : parport0 03c0-03df : vga+ 03f6-03f6 : 0000:00:07.1

03f6-03f6 : ide0

03f8-03ff : serial 04d0-04d1 : pnp 00:02 0cf8-0cff : PCI conf1 4000-403f : 0000:00:07.3

4000-4003 : ACPI PM1a_EVT_BLK 4008-400b : ACPI PM_TMR 400c-400f : ACPI GPE0_BLK

4040-4041 : ACPI PM1a_CNT_BLK 5000-500f : 0000:00:07.3

5000-5007 : piix4_smbus

d000-d01f : 0000:00:07.2 d400-d43f : 0000:00:09.0

d400-d43f : eepro100

d800-d8ff : 0000:00:0c.0

d800-d8ff : 8139too

dc00-dc3f : 0000:00:0f.0

dc00-dc3f : ESS Solo-1

e000-e00f : 0000:00:0f.0

e000-e00f : ESS Solo-1

e400-e40f : 0000:00:0f.0

e400-e40f : ESS Solo-1

e800-e803 : 0000:00:0f.0

e800-e803 : ESS Solo-1

ec00-ec03 : 0000:00:0f.0

ec00-ec03 : ESS Solo-1

f000-f00f : 0000:00:07.1

f000-f007 : ide0


Kernel Debug options:

CONFIG_I2C_DEBUG_CORE=y CONFIG_I2C_DEBUG_ALGO=y CONFIG_I2C_DEBUG_BUS=y CONFIG_I2C_DEBUG_CHIP=y CONFIG_HWMON_DEBUG_CHIP=y CONFIG_DEBUG_KERNEL=y

Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: adapter [SMBus PIIX4 adapter at 5000] registered Mar 7 21:04:44 skynet10 kernel: i2c /dev entries driver Mar 7 21:04:44 skynet10 kernel: i2c-core: driver [dev_driver] registered Mar 7 21:04:44 skynet10 kernel: i2c-dev: adapter [SMBus PIIX4 adapter at 5000] registered as minor 0 Mar 7 21:04:44 skynet10 kernel: i2c-core: driver [eeprom] registered Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x50 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: client [eeprom] registered with bus id 0-0050 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x51 ... Mar 7 21:04:44 skynet10 kernel: i2c-core: driver [w83781d] registered Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x20 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Transaction (pre): CNT=00, CMD=0d, ADD=40, DAT0=04, DAT1=00 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Error: no response! Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Transaction (post): CNT=00, CMD=0d, ADD=40, DAT0=04, DAT1=00 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x21 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Transaction (pre): CNT=00, CMD=0d, ADD=42, DAT0=04, DAT1=00 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Error: no response! Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: Transaction (post): CNT=00, CMD=0d, ADD=42, DAT0=04, DAT1=00 Mar 7 21:04:44 skynet10 kernel: i2c-adapter i2c-0: found normal entry for adapter 0, addr 0x22 ... and so on up to addr 0x2f

Hope this helps...

Changed 2 years ago by khali

CONFIG_HWMON_DEBUG_CHIP does affect all hwmon drivers, even if you don't see "#ifdef DEBUG" in the source code: when DEBUG is set, pr_debug() and dev_dbg() are activated. That being said, it seems it did not help in your specific case.

Comparing both versions /proc/ioports, I see the following in the latter than wasn't there in the former:

0294-0297 : pnp 00:02

So, as I suspected, the problem is caused by resource management changes, and has little to do with the conversion from i2c-isa to platform. Did the problem really show up in 2.6.22, not 2.6.23 or 2.6.24? I need to know so that I can backport the fix as needed.

What motherboard is this? Declaring I/O port range 0x294-0x297 for the W83781D doesn't make much sense. I suspect a Gigabyte board - they have done similar weird things several times already.

I have a candidate patch, I'll attach it, please give it a try and report.

Changed 2 years ago by ticket

Sorry, no luck this time :-/

Applied the patch, but it didn't work out. It was just my personal guess that this problem was introduced in 2.6.22 due to the i2c-isa stuff. Didn't try any version between 2.6.21.5 and 2.6.24.2, sorry...

The board is an industrial embedded single-board computer by Digital Logic (iirc), so definitely a bit unusual. Well, the actual components are quite standard however.

Any ideas? (Or at least how to obtain usable debug output)

Changed 2 years ago by khali

OK, I see my mistake. The design of the w83781d driver is a bit special and I forgot that it does a temporary request of I/O ports for detection purposes. This part needs additional care in your case.

I'm updating the patch, please download it and try again.

Changed 2 years ago by khali

Fix resource conflict between w83781d and pnp

Changed 2 years ago by ticket

That did it, great!

proc/ioports now looks like this:

0290-0297 : w83781d

0294-0297 : pnp 00:02

0295-0296 : w83781d

Everything works fine now. Thanks a lot for the quick response and fix.

Changed 23 months ago by khali

For reference, the same bug was reported here:
 http://bugzilla.kernel.org/show_bug.cgi?id=10357

Changed 23 months ago by khali

  • summary changed from W83781D on ISA detected but not in /sys after driver refactoring (module i2c-isa removed) to W83781D on ISA detected but not in /sys

Fixed in upstream kernel:
 http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2961cb22ef02850d90e7a12c28a14d74e327df8d

I will now send this patch to the stable kernel team so that it can be included in 2.6.24.5.

Changed 22 months ago by khali

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in kernel 2.6.24.5.

Note: See TracTickets for help on using tickets.