Subject: Re: PR/36744 CVS commit: src/sys/dev
To: None <gnats-bugs@NetBSD.org>
From: Simon Burge <simonb@NetBSD.org>
List: netbsd-bugs
Date: 09/06/2007 14:16:55
[ Resent hoping to get it attached to the PR this time, with some
  new info ]

Jeff Rizzo wrote:

> From: Jeff Rizzo <riz@netbsd.org>
> To: gnats-bugs@NetBSD.org
> Cc: 
> Subject: PR/36744 CVS commit: src/sys/dev
> Date: Sat,  1 Sep 2007 22:19:25 +0000 (UTC)
> 
>  Module Name:	src
>  Committed By:	riz
>  Date:		Sat Sep  1 22:19:25 UTC 2007
>  
>  Modified Files:
>  	src/sys/dev/i2c: i2c.c
>  	src/sys/dev/pci: ichsmb.c nfsmb.c
>  
>  Log Message:
>  For SMBus, add the ability to enumerate devices on the bus.
>  This does NOT identify the devices, merely indicates the
>  presence of devices at certain addresses.  Tested on ichsmb
>  and nfsmb - other SMBus devices will need to ensure the
>  proper bus type is set. (I2C_TYPE_SMBUS)
>  
>  From Nicolas Joly, via Paul Goyette, in PR#36744.
>  
>  
>  To generate a diff of this commit:
>  cvs rdiff -r1.14 -r1.15 src/sys/dev/i2c/i2c.c
>  cvs rdiff -r1.8 -r1.9 src/sys/dev/pci/ichsmb.c
>  cvs rdiff -r1.5 -r1.6 src/sys/dev/pci/nfsmb.c

This change causes my Dell 640m laptop to powerdown when I use
reboot(8), instead of rebooting normally.  This happens with both UP and
MP kernels, and both on HEAD and on the jmcneill-pm branch.

Here's some dmesg:

   pci0 at mainbus0 bus 0: configuration mode 1
   pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
   pchb0 at pci0 dev 0 function 0
   pchb0: Intel 82945GM/PM/GMS Host Bridge (rev. 0x03)
      ...
   ichsmb0 at pci0 dev 31 function 3: Intel 82801GB/GR SMBus Controller (rev. 0x01)
   ichsmb0: interrupting at ioapic0 pin 17 (irq 4)
   iic0 at ichsmb0: I2C bus
   iic0: devices at 0x00 0x08 0x50 0x69
   ichsmb0: exec: op 1, addr 0x6a, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x6b, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x6c, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x6d, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x6e, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x6f, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x70, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x71, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x72, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x73, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x74, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x75, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x76, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x77, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x78, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x79, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7a, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7b, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7c, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7d, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7e, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>
   ichsmb0: exec: op 1, addr 0x7f, cmdlen 1, len 1, flags 0x08: timeout, status 0x41<BUSY,INUSE>

At a guess, the read from the device at 0x69 is causing some issue with
keeping the bus tied up or something and then just maybe the reboot
fails after that because the BIOS can no longer talk any smbus devices.

For now, I've just commented out the

	iba.iba_type = I2C_TYPE_SMBUS;

sys/dev/pci/ichsmb.c and that gets things working for me again.  I
noticed Jared disabled the new code in dev/i2c/i2c.c overnight on the
jmcneill-pm branch.

Perhaps this new code should be disabled on HEAD as well until all its
effects are known?  At least I think the PR should be reopened.

Simon.