From logix@foobar.franken.de  Sun Apr 21 17:37:24 2002
Return-Path: <logix@foobar.franken.de>
Received: from mailout05.sul.t-online.com (mailout05.sul.t-online.com [194.25.134.82])
	by hub.freebsd.org (Postfix) with ESMTP id 649EF37B405
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 21 Apr 2002 17:37:23 -0700 (PDT)
Received: from fwd08.sul.t-online.de 
	by mailout05.sul.t-online.com with smtp 
	id 16zRpV-0001H3-03; Mon, 22 Apr 2002 02:37:17 +0200
Received: from foobar.franken.de (520066542279-0001@[217.235.93.55]) by fmrl08.sul.t-online.com
	with esmtp id 16zRpT-0pMqRcC; Mon, 22 Apr 2002 02:37:15 +0200
Received: (from logix@localhost)
	by foobar.franken.de (8.11.3/8.11.1) id g3M0bDf23725;
	Mon, 22 Apr 2002 02:37:13 +0200 (CEST)
	(envelope-from logix)
Message-Id: <200204220037.g3M0bDf23725@foobar.franken.de>
Date: Mon, 22 Apr 2002 02:37:13 +0200 (CEST)
From: Harold Gutch <logix@foobar.franken.de>
Reply-To: logix@foobar.franken.de
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: smbus/bktr crash when omitting "device iicsmb"
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         37326
>Category:       kern
>Synopsis:       [bktr] smbus/bktr crash when omitting "device iicsmb"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 21 17:40:01 PDT 2002
>Closed-Date:    
>Last-Modified:  Thu Nov 04 08:17:10 GMT 2004
>Originator:     Harold Gutch
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD overdose.franken.de 4.5-STABLE FreeBSD 4.5-STABLE #8: Mon Apr 22 00:04:52 CEST 2002 root@overdose.franken.de:/space2/obj/space2/src/sys/OVERDOSE i386
>Description:
A kernel with

	device		bktr
	device		smbus
	device		viapm
	device		smb
	device		iicbus
	device		iicbb

but WITHOUT

	device		iicsmb

in the configfile compiles without problems.  When trying to access /dev/smb0
using e.g. lmmon from the ports, FreeBSD crashes.

These are the relevant parts from the stacktrace I made after the crash:

#5  0xc027b75b in trap (frame={tf_fs = 16, tf_es = 16, tf_ds = 16, tf_edi = 0, 
      tf_esi = -1059782784, tf_ebp = -861672200, tf_isp = -861672220, 
      tf_ebx = -1063041088, tf_edx = -1063013120, tf_ecx = -1059782784, 
      tf_eax = 0, tf_trapno = 12, tf_err = 0, tf_eip = -1072208830, tf_cs = 8, 
      tf_eflags = 66118, tf_esp = -861672176, tf_ss = -1072336249})
    at /space2/src/sys/i386/i386/trap.c:458
#6  0xc0176442 in device_get_softc (dev=0x0)
    at /space2/src/sys/kern/subr_bus.c:980
#7  0xc0157287 in iicbus_request_bus (bus=0x0, dev=0xc0d4ff80, how=3)
    at /space2/src/sys/dev/iicbus/iiconf.c:103
#8  0xc0228170 in bti2c_smb_callback (dev=0xc0d4ff80, index=1, data=0xcca3ed74)
    at /space2/src/sys/dev/bktr/bktr_i2c.c:237

Note bus=0x0 in frame #7 and dev=0x0 in frame #6.

>How-To-Repeat:
Add the options

	device		bktr
	device		smbus
	device		viapm
	device		smb
	device		iicbus
	device		iicbb

Be sure NOT to include

	device		iicsmb

to your kernel configfile, recompile and -install that kernel and reboot.
Install ports/sysutils/lmmon and run it.

>Fix:
The obvious "fix" (a check wether sc->iicbus is NULL) in dev/bktr/bktr_i2c.c
doesn't work - even worse, it hangs the machine when accessing smbus (while
the plain source at least panics and then reboots).  As I don't have any
closer insight on smbus, I'm sorry to say that  can't provide a working fix
right now.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->roger 
Responsible-Changed-By: johan 
Responsible-Changed-When: Tue Aug 20 14:19:57 PDT 2002 
Responsible-Changed-Why:  
Over to bktr maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=37326 
Responsible-Changed-From-To: roger->freebsd-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Nov 4 08:17:00 GMT 2004 
Responsible-Changed-Why:  
Assignee is currently away from doing FreeBSD work at the moment, so 
at his request, return this one to the pool. 

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