From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick Mansfield Date: Wed, 27 Apr 2005 23:14:08 +0000 Subject: Re: [linux-usb-devel] usb-storage bug in 2.6.12-rc3 Message-Id: <20050427231408.GA31053@us.ibm.com> List-Id: References: <1114633284.16803.17.camel@daxter.boston.redhat.com> In-Reply-To: <1114633284.16803.17.camel@daxter.boston.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Wed, Apr 27, 2005 at 05:21:10PM -0400, Alan Stern wrote: > David's right. Why did kobject_hotplug() move out of kobject_add() and > into its callers sometime after 2.6.11? In particular the invocation in > device_add() is in the wrong place; it needs to come before > bus_add_device() starts probing for drivers. Otherwise, as David points > out, when the drivers start registering child devices from their probe > methods, the hotplug events for those child devices will appear before the > event for the parent. > > Alan Stern But bus_add_device() calls device_add_attrs() to create attrs, if you call it after the hotplug, the user space hotplug event shows up before the sysfs attrs are created (if the driver is using the bus->dev_attrs field). I'd like to see device_add() split into two pieces, one component that initializes the struct device, and another to call the hotplug and the bus probe. And as Kay S. suggested, a new device_register() that is the functional equivalent of today's device_add(). For scsi, we can't easily use the dev_attrs, so this would allow attributes to be in place prior to the hotplug event (of the block device): device_add(), create a bunch of classes and attrs, then device_ready() [or wtf you want to name it]. PS: I haven't had time to generate patches :-( -- Patrick Mansfield ------------------------------------------------------- SF.Net email is sponsored by: Tell us your software development plans! Take this survey and enter to win a one-year sub to SourceForge.net Plus IDC's 2005 look-ahead and a copy of this survey Click here to start! http://www.idcswdc.com/cgi-bin/survey?id5hix _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel