From owner-freebsd-bugs@FreeBSD.ORG Thu Jan 22 08:30:21 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E2EF16A4CF for ; Thu, 22 Jan 2004 08:30:21 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id A160C43D31 for ; Thu, 22 Jan 2004 08:30:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0MGUGFR090956 for ; Thu, 22 Jan 2004 08:30:16 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0MGUGdE090955; Thu, 22 Jan 2004 08:30:16 -0800 (PST) (envelope-from gnats) Resent-Date: Thu, 22 Jan 2004 08:30:16 -0800 (PST) Resent-Message-Id: <200401221630.i0MGUGdE090955@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jun Su Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDD0E16A4CE; Thu, 22 Jan 2004 08:22:11 -0800 (PST) Received: from arbornet.org (m-net.arbornet.org [209.142.209.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8AF8E43D39; Thu, 22 Jan 2004 08:22:05 -0800 (PST) (envelope-from junsu@m-net.arbornet.org) Received: from m-net.arbornet.org (localhost [127.0.0.1]) by arbornet.org (8.12.3p2/8.11.2) with ESMTP id i0MGPNBJ081680; Thu, 22 Jan 2004 11:25:23 -0500 (EST) (envelope-from junsu@m-net.arbornet.org) Received: (from junsu@localhost) by m-net.arbornet.org (8.12.3p2/8.12.3/Submit) id i0MGPNpJ081679; Thu, 22 Jan 2004 11:25:23 -0500 (EST) Message-Id: <200401221625.i0MGPNpJ081679@m-net.arbornet.org> Date: Thu, 22 Jan 2004 11:25:23 -0500 (EST) From: Jun Su To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: jhb@FreeBSD.org Subject: kern/61734: [PATCH]Incorrect unit number when kldload module X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jun Su List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 16:30:21 -0000 >Number: 61734 >Category: kern >Synopsis: [PATCH]Incorrect unit number when kldload module >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Jan 22 08:30:16 PST 2004 >Closed-Date: >Last-Modified: >Originator: Jun Su >Release: FreeBSD 4.6.2-RELEASE-p26 i386 >Organization: NONE >Environment: System: FreeBSD 5.2 -Curret >Description: If a device has some hint value in device.hints, when kldload the module after boot, the unit number is incorrect. for example, if_lnc driver. in device.hints: hint.lnc.0.at="isa" hint.lnc.0.disabled="1" hint.lnc.0.port="0x280" hint.lnc.0.irq="10" hint.lnc.0.drq="0" Don;t load the if_lnc.ko when boot. Also don't compile the driver into kernel. When kldload if_lnc.ko, the device will be lnc1 instead of lnc0. This name change make the config in rc.conf incorrect. I think we need fix this. >How-To-Repeat: This behavir will be occured in any isa driver. >Fix: --- /usr/src/sys/isa/isa_common.c Wed Jul 9 02:56:58 2003 +++ isa_common.c Thu Jan 22 09:08:34 2004 @@ -613,7 +613,16 @@ } } } + for (i = 0; i < nchildren; i++) { + device_t child = children[i]; + struct isa_device *idev = DEVTOISA(child); + if (TAILQ_FIRST(&idev->id_configs)) + continue; + + device_delete_child(dev, child); + } + free(children, M_TEMP); isa_running = 1; >Release-Note: >Audit-Trail: >Unformatted: