From owner-freebsd-new-bus Fri Aug 30 19:32:37 2002 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 0CEF637B400; Fri, 30 Aug 2002 19:32:36 -0700 (PDT) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 481D743E3B; Fri, 30 Aug 2002 19:32:35 -0700 (PDT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.3/8.12.3) with ESMTP id g7V2WY2F048726; Fri, 30 Aug 2002 20:32:34 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 30 Aug 2002 20:32:28 -0600 (MDT) Message-Id: <20020830.203228.35798916.imp@bsdimp.com> To: jhb@FreeBSD.ORG Cc: new-bus@FreeBSD.ORG Subject: Re: bus_generic_probe() is wrong I think From: "M. Warner Losh" In-Reply-To: References: X-Mailer: Mew version 2.1 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-new-bus@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message: John Baldwin writes: : If we are going to support having multiple driver's for a given device : which is a bus (like we do now for PCI busses and like I am doing for : this concept of a system buson i386) then I think that bus devices do : not need to go identify child devices until after they have won the : probe and are being attached. Thus, I'm ending up calling : bus_generic_probe() in my attach routines instead of my probe routines. : Does this make sense or am I missing something? I at least have to do : this in the system bus case here for the same reasons that when I added : another PCI bus driver, I had to change the PCI drivers to add children : devices (equivalent of doing an identify) during attach() time and not : during probe() time. A more fundamental question is why bus_generic_probe() does the child attach/probe? In the probe routine, there's no guarantee that the bus will actually attach at some later point. Shouldn't that be in a bus_generic_attach() routine? The probe should just say 'is this bus here' and the attach should make it possible to then probe the children after a successful attach. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-new-bus" in the body of the message