From owner-freebsd-hackers Sun Mar 23 2:55:23 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B59F537B401; Sun, 23 Mar 2003 02:55:21 -0800 (PST) Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.122.47]) by mx1.FreeBSD.org (Postfix) with ESMTP id A52FF43F3F; Sun, 23 Mar 2003 02:55:20 -0800 (PST) (envelope-from gurney_j@resnet.uoregon.edu) Received: by resnet.uoregon.edu (Postfix, from userid 1001) id 0D0EB1930E; Sun, 23 Mar 2003 02:55:07 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by resnet.uoregon.edu (Postfix) with ESMTP id DF6A41D112; Sun, 23 Mar 2003 17:55:07 +0700 (ICT) Date: Sun, 23 Mar 2003 17:55:07 +0700 (ICT) From: John-Mark Gurney To: "Matthew N. Dodd" Cc: dfr@FreeBSD.ORG, Subject: Re: bug in subr_bus.c? In-Reply-To: <20030321094447.E8716@sasami.jurai.net> Message-ID: <20030323174445.K36261-100000@resnet.uoregon.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 21 Mar 2003, Matthew N. Dodd wrote: > On Fri, 21 Mar 2003, John-Mark Gurney wrote: > > So, the driver can: > > a) delete it's own children, but if it gets removed via > > device_delete_child, this work is already down for you. > > If you create children then you're going to be involved in removing them. > > There are helper routines that simplify some operations but I don't > believe any changes to subr_bus.c are needed. I finally got it working.. I'm not sure exactly what I did, but I can load/unload the driver w/o crashing the machine... The bus code could use some locking in it... like you can't delete_child from child_detache... and/or better docs on how to handle children... I'm not even sure how I was doing things wrong, but I think it might of been problems with my code not calling bus_generic_detach before calling device_child_delete... Hmmm.. I'm still not sure exactly why things started behaving properly... I know a few times I was trying to delete a device that was in the process of being detached (which of course would try to detach it again)... Quite confusing.. :( Thanks for your help though. later. John-Mark To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message