From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 30 22:40:43 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4FEEA1065670 for ; Mon, 30 Jul 2012 22:40:43 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from qmta03.emeryville.ca.mail.comcast.net (qmta03.emeryville.ca.mail.comcast.net [76.96.30.32]) by mx1.freebsd.org (Postfix) with ESMTP id 2EAF38FC1D for ; Mon, 30 Jul 2012 22:40:43 +0000 (UTC) Received: from omta02.emeryville.ca.mail.comcast.net ([76.96.30.19]) by qmta03.emeryville.ca.mail.comcast.net with comcast id gcT01j0010QkzPwA3mgiGV; Mon, 30 Jul 2012 22:40:42 +0000 Received: from damnhippie.dyndns.org ([24.8.232.202]) by omta02.emeryville.ca.mail.comcast.net with comcast id gmgh1j00G4NgCEG8Nmgi1Y; Mon, 30 Jul 2012 22:40:42 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q6UMed69034570; Mon, 30 Jul 2012 16:40:39 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) From: Ian Lepore To: John Baldwin In-Reply-To: <201207301706.02788.jhb@freebsd.org> References: <201207301706.02788.jhb@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 30 Jul 2012 16:40:39 -0600 Message-ID: <1343688039.1101.112.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers , freebsd-current@freebsd.org, Arnaud Lacombe Subject: Re: newbus' ivar's limitation.. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2012 22:40:43 -0000 On Mon, 2012-07-30 at 17:06 -0400, John Baldwin wrote: > On Tuesday, July 17, 2012 2:03:14 am Arnaud Lacombe wrote: > > Hi, > > > > On Fri, Jul 13, 2012 at 1:56 PM, Arnaud Lacombe wrote: > > > Hi, > > > > > > On Thu, Jul 12, 2012 at 1:20 AM, Warner Losh wrote: > > >> [..] > > >> Honestly, though, I think you'll be more pissed when you find out that > the N:1 interface that you want is being done in the wrong domain. But I've > been wrong before and look forward to seeing your replacement. > > >> > > > I will just pass function pointers for now, if things should be done > > > dirty, let's be explicit about it. > > > > > > Now, the hinted device attachment did work quite smoothly, however, I > > > would have a few suggestion: > > > 1) add a call to bus_enumerate_hinted_children() before the call > > > DEVICE_IDENTIFY() call in bus_generic_driver_added() > > > > > > this is required to be able to support dynamic loading and attachment > > > of hinted children. > > I'm not sure this is a feature we want to support (to date hinted children > have only been created at boot time). It seems to me that the bus should be in control of calling bus_enumerate_hinted_children() at whatever time works best for it. Also, shouldn't it only ever be called once? The comment block for BUS_HINTED_CHILD in bus_if.h says "This method is only called in response to the parent bus asking for hinted devices to be enumerated." I think one of the implications of that is that any given bus may not call bus_enumerate_hinted_children() because it may not be able to do anything for hinted children. Adding a "hint.somedev.0.at=somebus" and then forcing the bus to enumerate hinted children amounts to forcing the bus to adopt a child it may not be able to provide resources for, which sounds like a panic or crash waiting to happen (or at best, no crash but nothing useful happens either). -- Ian