Bug 32605 - SMBus driver broken
Summary: SMBus driver broken
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 4.4-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-08 16:40 UTC by larse
Modified: 2005-07-26 16:48 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description larse 2001-12-08 16:40:00 UTC
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.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-10 12:40:52 UTC
State Changed
From-To: open->feedback

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.
Comment 2 Sheldon Hearn 2001-12-10 15:51:04 UTC
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
>
Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2001-12-10 16:13:21 UTC
Responsible Changed
From-To: freebsd-bugs->nsouch

Nicholas is looking into this.  Apologies about the false claims 
of no active maintainer. :-)
Comment 4 nsouch 2001-12-10 16:35:18 UTC
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;
}


--
Alcôve Technical Manager - Nicolas.Souchu@fr.alcove.com - http://www.alcove.com
FreeBSD Developer - nsouch@freebsd.org
Comment 5 larse 2001-12-10 17:27:40 UTC
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
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2005-07-24 16:55:25 UTC
Responsible Changed
From-To: nsouch->linimon

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?
Comment 7 Lars Eggert 2005-07-26 12:32:26 UTC
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
Comment 8 Mark Linimon freebsd_committer freebsd_triage 2005-07-26 16:48:29 UTC
State Changed
From-To: feedback->closed

Submitter can no longer test for this problem and suggests this PR should 
just be closed.