From owner-freebsd-new-bus@FreeBSD.ORG Thu Mar 18 00:02:29 2004 Return-Path: Delivered-To: freebsd-new-bus@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E1F216A4CE for ; Thu, 18 Mar 2004 00:02:29 -0800 (PST) Received: from gvr.gvr.org (gvr-gw.gvr.org [80.126.103.228]) by mx1.FreeBSD.org (Postfix) with ESMTP id 27C1E43D1F for ; Thu, 18 Mar 2004 00:02:29 -0800 (PST) (envelope-from guido@gvr.org) Received: by gvr.gvr.org (Postfix, from userid 657) id 2D3E42A; Thu, 18 Mar 2004 09:02:30 +0100 (CET) Date: Thu, 18 Mar 2004 09:02:30 +0100 From: Guido van Rooij To: new-bus@FreeBSD.org Message-ID: <20040318080230.GA87270@gvr.gvr.org> Mime-Version: 1.0 Content-Type: message/rfc822 Content-Disposition: inline Subject: ppbus probe problem X-BeenThere: freebsd-new-bus@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD's new-bus architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Mar 2004 08:02:29 -0000 As the newbus gurus, I hope you can shed a light on the following: I am trying to resurrect tw.c into current. While modifying it, I came across a weird problem. If you load/unload a ppbus driver (if at all possible), each additional load/unload leads to an additional probe the next time you load that driver. E.g, if you add a printf to the probe function in vpo.c, you see: command: dmesg beck# kldload ./vpo.ko vpo probe called beck# kldunload ./vpo.ko beck# kldload ./vpo.ko vpo probe called vpo probe called beck# kldunload ./vpo.ko beck# kldload ./vpo.ko vpo probe called vpo probe called vpo probe called etc. Someone suggested that the identify function was responsible for this: static void vpo_identify(driver_t *driver, device_t parent) { BUS_ADD_CHILD(parent, 0, "vpo", -1); } Nowhere is the child removed from the parent at detach (also there is no BUS_REMOVE_CHILD method). What is the correct way to fix the probe call incrementing problem? -Guido