From owner-freebsd-bugs@FreeBSD.ORG Tue Dec 5 20:40:08 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C2F6916A403 for ; Tue, 5 Dec 2006 20:40:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.FreeBSD.org (Postfix) with ESMTP id 419CD43C9D for ; Tue, 5 Dec 2006 20:39:27 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kB5Ke87h091745 for ; Tue, 5 Dec 2006 20:40:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kB5Ke83Y091744; Tue, 5 Dec 2006 20:40:08 GMT (envelope-from gnats) Date: Tue, 5 Dec 2006 20:40:08 GMT Message-Id: <200612052040.kB5Ke83Y091744@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: John Baldwin Cc: Subject: Re: kern/103041: [ipmi] unloading ipmi panics Dell PE 2850, ipmi doesn't work, 1850 works fine X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John Baldwin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Dec 2006 20:40:08 -0000 The following reply was made to PR kern/103041; it has been noted by GNATS. From: John Baldwin To: Alexander Logvinov Cc: bug-followup@freebsd.org Subject: Re: kern/103041: [ipmi] unloading ipmi panics Dell PE 2850, ipmi doesn't work, 1850 works fine Date: Tue, 5 Dec 2006 15:33:52 -0500 On Monday 04 December 2006 00:31, Alexander Logvinov wrote: > Hello John! > > Saturday, December 2, 2006, 4:42:49 AM, you wrote: > > > irq 16 at device 0.4 on pci4 > >> ipmi0: using KSC interface > >> ipmi0: KCS: Failed to read address > >> ipmi0: KCS: Failed to read address > >> ipmi0: KCS: Failed to read address > >> ipmi0: Failed GET_DEVICE_ID: 5 > > I've yet to determine why these chips don't work. :( They seem to just be > > broken. > :( > > > Try this patch to fix the kldunload though: > It works, but: > > # kldunload ipmi > Warning: memory type ipmi leaked memory on destroy (1 allocations, 64 bytes leaked). Ok, try below: Index: ipmi.c =================================================================== RCS file: /usr/cvs/src/sys/dev/ipmi/ipmi.c,v retrieving revision 1.6 diff -u -r1.6 ipmi.c --- ipmi.c 12 Oct 2006 16:26:42 -0000 1.6 +++ ipmi.c 5 Dec 2006 20:32:50 -0000 @@ -756,18 +756,22 @@ error = ipmi_submit_driver_request(sc, req, MAX_TIMEOUT); if (error == EWOULDBLOCK) { device_printf(dev, "Timed out waiting for GET_DEVICE_ID\n"); + ipmi_free_request(req); return; } else if (error) { device_printf(dev, "Failed GET_DEVICE_ID: %d\n", error); + ipmi_free_request(req); return; } else if (req->ir_compcode != 0) { device_printf(dev, "Bad completion code for GET_DEVICE_ID: %d\n", req->ir_compcode); + ipmi_free_request(req); return; } else if (req->ir_replylen < 5) { device_printf(dev, "Short reply for GET_DEVICE_ID: %d\n", req->ir_replylen); + ipmi_free_request(req); return; } @@ -888,14 +892,16 @@ sc->ipmi_cloning = 0; IPMI_UNLOCK(sc); - EVENTHANDLER_DEREGISTER(dev_clone, sc->ipmi_clone_tag); + if (sc->ipmi_clone_tag) + EVENTHANDLER_DEREGISTER(dev_clone, sc->ipmi_clone_tag); #else if (sc->ipmi_idev.ipmi_open) { IPMI_UNLOCK(sc); return (EBUSY); } IPMI_UNLOCK(sc); - destroy_dev(sc->ipmi_idev.ipmi_cdev); + if (sc->ipmi_idev.ipmi_cdev) + destroy_dev(sc->ipmi_idev.ipmi_cdev); #endif /* Detach from watchdog handling and turn off watchdog. */ -- John Baldwin