From nobody@FreeBSD.org  Sat Dec  8 08:32:41 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 44DC837B630
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  8 Dec 2001 08:31:17 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.6/8.11.6) id fB8GVG560613;
	Sat, 8 Dec 2001 08:31:16 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200112081631.fB8GVG560613@freefall.freebsd.org>
Date: Sat, 8 Dec 2001 08:31:16 -0800 (PST)
From: Lars Eggert <larse@isi.edu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: SMBus driver broken
X-Send-Pr-Version: www-1.0

>Number:         32605
>Category:       kern
>Synopsis:       SMBus driver broken
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    linimon
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 08 08:40:00 PST 2001
>Closed-Date:    Tue Jul 26 15:48:55 GMT 2005
>Last-Modified:  Tue Jul 26 15:48:55 GMT 2005
>Originator:     Lars Eggert
>Release:        4.4-RELEASE
>Organization:
USC Information Sciences Institute
>Environment:
>Description:
The SMBus driver (smb) doesn't work on all my machines (a Dell SMP system and a Dell laptop, see below). Both have SMBus hardware.

Also, a somewhat tangential issue, all SMBus utils assume the system has only one SMBus - this is not always true (e.g. whith a BrookTree card, see below).

First system is a SMP Dell Precision, relevant dmesg info:

bktr0: <BrookTree 878> mem 0xf6001000-0xf6001fff irq 13 at device 9.0 on 
pci2
smb0: <SMBus generic I/O> on smbus0
bktr0: Hauppauge Model 61381 D423
bktr0: Detected a MSP3430G-A4 at 0x80
bktr0: Hauppauge WinCast/TV, Philips FR1236 NTSC FM tuner, msp3400c 
stereo, remote control.
ichsmb0: <Intel 82801AA (ICH) SMBus controller> port 0xdcd0-0xdcdf irq 
13 at device 31.3 on pci0
smbus1: <System Management Bus> on ichsmb0
smb1: <SMBus generic I/O> on smbus1

On this machine, using SMBus utilities (e.g. lmmon from ports) on smb0 (attached to the BrookTree card) causes a kernel lockup that requires a hard reset. Using them on smb1 results in "device not configured".

Second system is a Dell Latitude C600 laptop, relevant dmesg info:

apm0: <APM BIOS> on motherboard
apm: found APM BIOS v1.2, connected at v1.2
intpm0: <Intel 82371AB Power management controller> port 0x840-0x84f irq 
9 at device 7.3 on pci0
intpm0: I/O mapped 840
intpm0: intr IRQ 9 enabled revision 0
smbus0: <System Management Bus> on intsmb0
smb0: <SMBus general purpose I/O> on smbus0
intpm0: PM I/O mapped 800

Using lmmon here also results in a "device not configured" message.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: sheldonh 
State-Changed-When: Mon Dec 10 04:40:52 PST 2001 
State-Changed-Why:  
The smbus(4) driver doesn't have an active maintainer.  If you want the 
problem fixed, you're going to have to try to get a better idea of 
what the problem is. 

Try booting the systems that work with boot -v and comparing the 
attach messages with those on a system that doesn't work (also 
booted with boot -v). 

Also, try to provide more detail on the exact hardware in the boxes 
(both working and not) using pciconf -vl.  Note that the -v 
option was only added to picconf(8) in -STABLE recently. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32605 

From: Sheldon Hearn <sheldonh@starjuice.net>
To: Lars Eggert <larse@ISI.EDU>
Cc: freebsd-gnats-submit@FreeBSD.org, nsouch@freebsd.org
Subject: Re: misc/32605: SMBus driver broken 
Date: Mon, 10 Dec 2001 17:51:04 +0200

 How wow, you're right!
 
 I didn't realize Nicholas was still working on this.  He tends to go
 dormant for long periods of time. :-)
 
 Will you try out Nicholas' patch and copy <freebsd-gnats-submit> with
 your results?
 
 Ciao,
 Sheldon.
 
 ----- Original Message -----
 
 Date:  Mon, 10 Dec 2001 07:43:58 -0800
 From:  Lars Eggert <larse@ISI.EDU>
 To:  sheldonh@FreeBSD.org
 cc:  freebsd-bugs@FreeBSD.org, nsouch@freebsd.org
 Subject:  Re: misc/32605: SMBus driver broken
 
 
 > Hi,
 > 
 > sheldonh@FreeBSD.org wrote:
 > 
 > > State-Changed-Why: 
 > > The smbus(4) driver doesn't have an active maintainer.  If you want the
 > > problem fixed, you're going to have to try to get a better idea of
 > > what the problem is.
 > 
 > 
 > Isn't nsouch working on it? At least he (she?) seems to have a 
 > relatively new patch available at 
 > http://people.freebsd.org/~nsouch/iicbus.html (Which I tried and doesn't 
 > seem to make things better.)
 > 
 >  
 > > Try booting the systems that work with boot -v and comparing the
 > > attach messages with those on a system that doesn't work (also
 > > booted with boot -v).
 > 
 > 
 > Both systems in the PR don't work - so far I haven't found a system 
 > which it *does* work on.
 > 
 >  
 > > Also, try to provide more detail on the exact hardware in the boxes
 > > (both working and not) using pciconf -vl.  Note that the -v
 > > option was only added to picconf(8) in -STABLE recently.
 > > 
 > > http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32605
 > 
 > I run 4.4-RELEASE - but I could build the -STABLE pciconf and run it, if 
 > that'll work.
 > 
 > Thanks,
 > Lars
 > -- 
 > Lars Eggert <larse@isi.edu>               Information Sciences Institute
 > http://www.isi.edu/larse/              University of Southern California
 > 
 
Responsible-Changed-From-To: freebsd-bugs->nsouch 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Dec 10 08:13:21 PST 2001 
Responsible-Changed-Why:  
Nicholas is looking into this.  Apologies about the false claims 
of no active maintainer. :-) 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32605 

From: Nicolas Souchu <nsouch@fr.alcove.com>
To: freebsd-gnats-submit@FreeBSD.org, larse@isi.edu
Cc:  
Subject: Re: misc/32605: SMBus driver broken
Date: Mon, 10 Dec 2001 17:35:18 +0100

 The following program will show you what can be found on your SMBus. It
 works here for an
 intel based machine.
 
 One must note that even if the smbus driver works, lmmon or healthd may
 not support the
 monitoring chip (see healthd manpage for more info). Especially, when
 lmmon reports
 IOTCL error it is when the chip at I2C addr 0x5a is not found (see
 perror() call in the lmmon.c).
 
 You may change the /dev/smb? as needed.
 
 #include <stdlib.h>
 #include <fcntl.h>
 #include <machine/smb.h>
 
 int doioctl(int alias, int cmd, caddr_t param)
 {
         int error = 1;
         int retry = 3;
 
         while (error && retry--) {
                 usleep(200);
                 error = ioctl(alias, cmd, param);
         }
 
         return (error);
 }
 
 int main (int argc,char argv[])
 {
         int alias, i;
         unsigned char byte=0;
         struct smbcmd cmd;
 
         bzero(&cmd, sizeof(cmd));
         cmd.data.byte_ptr = &byte;
         cmd.cmd = 0x0;
 
         alias = open("/dev/smb0", O_RDWR);
 
         for (i=2; i<254; i+=2)
         {
           if (i != 0xd2) {
                   cmd.slave=(u_char)i;
                   if(doioctl(alias, SMB_READB, (caddr_t)&cmd)!=-1){
                         printf("%x found.\n",i);
                   }
           }
         }
 
         close(alias);
         return 0;
 }
 
 
 --
 Alcve Technical Manager - Nicolas.Souchu@fr.alcove.com - http://www.alcove.com
 FreeBSD Developer - nsouch@freebsd.org
 
 
 

From: Lars Eggert <larse@ISI.EDU>
To: Nicolas Souchu <nsouch@fr.alcove.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/32605: SMBus driver broken
Date: Mon, 10 Dec 2001 09:27:40 -0800

 Nicolas Souchu wrote:
  > The following program will show you what can be found on your SMBus.
  >  It works here for an intel based machine.
 
 This is what I get on the Dell laptop (I'm at IETF right now, so I can't 
 test my SMP desktop, will do in a week):
 
 38 found.
 60 found.
 a0 found.
 
  > One must note that even if the smbus driver works, lmmon or healthd
  > may not support the monitoring chip (see healthd manpage for more
  > info). Especially, when lmmon reports IOTCL error it is when the
  > chip at I2C addr 0x5a is not found (see perror() call in the
  > lmmon.c).
 
 Ah, I didn't know that (I'm new to setting up SMBus). Since it wasn't 
 found, that explains the issue.
 
 Lars
 -- 
 Lars Eggert <larse@isi.edu>               Information Sciences Institute
 http://www.isi.edu/larse/              University of Southern California
 
Responsible-Changed-From-To: nsouch->linimon 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Jul 24 15:55:25 GMT 2005 
Responsible-Changed-Why:  
Assignee has agreed that this PR should be reassigned to the pool 
due to inactivity. 

To original submitter: is this still a problem on current releases? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32605 

From: Lars Eggert <lars.eggert@netlab.nec.de>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/32605: SMBus driver broken
Date: Tue, 26 Jul 2005 13:32:26 +0200

 Hi,
 
 I cannot test whether the bug persists as I have no longer access to  
 the equipment. OK to close this, IMO.
 
 Lars
 --
 Lars Eggert                                     NEC Network Laboratories
 
 
 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Jul 26 15:48:29 GMT 2005 
State-Changed-Why:  
Submitter can no longer test for this problem and suggests this PR should 
just be closed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=32605 
>Unformatted:
