linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [linux-usb-devel] usb-storage bug in 2.6.12-rc3
Date: Thu, 28 Apr 2005 00:47:23 +0000	[thread overview]
Message-ID: <20050428004723.GA4788@vrfy.org> (raw)
In-Reply-To: <1114633284.16803.17.camel@daxter.boston.redhat.com>

On Wed, Apr 27, 2005 at 04:14:08PM -0700, Patrick Mansfield wrote:
> 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.

Yes, that's bad, sorry, while I've moved the hotplug event generation to this
point to get saner sysfs timing I didn't realized this.

> 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).

Right, it would be nice if the sysfs-attributes are ready before the event is
fired. This saves us all the sleep and stat loops in userspace.

> 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().

I still like that and I can do the patch to split device_add so SCSI can
add the device but fire the hotplug event after the device is fully registered.

Greg, ok if I prepare a patch to look at or don't you like the split?

Otherwise it don't see how this can be fixed and we need to move the hotplug
event in core.c up where it was before and stick with the old sysfs
timing.

Thanks,
Kay


-------------------------------------------------------
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?id\x105hix
_______________________________________________
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

  parent reply	other threads:[~2005-04-28  0:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 20:21 usb-storage bug in 2.6.12-rc3 David Zeuthen
2005-04-27 21:21 ` [linux-usb-devel] " Alan Stern
2005-04-27 23:14 ` Patrick Mansfield
2005-04-28  0:47 ` Kay Sievers [this message]
2005-04-28  4:34 ` Greg KH
2005-04-28 10:21 ` Kay Sievers
2005-04-28 13:35 ` E. Oltmanns
2005-04-28 14:15 ` Patrick Mansfield
2005-04-29 14:23 ` E. Oltmanns
2005-04-29 18:23 ` [linux-usb-devel] " Roman Kagan
2005-04-29 19:28 ` David Brownell
2005-04-29 19:35 ` Oliver Neukum
2005-04-29 20:00 ` Greg KH
2005-04-29 20:01 ` Greg KH
2005-04-29 20:16 ` Oliver Neukum
2005-04-29 20:50 ` David Brownell
2005-04-29 21:07 ` David Zeuthen
2005-05-04  7:05 ` Roman Kagan
2005-05-18 14:19 ` David Zeuthen
2005-05-18 17:03 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050428004723.GA4788@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).