linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] USB hotplug race
Date: Sat, 27 Mar 2004 00:05:52 +0000	[thread overview]
Message-ID: <200403270105.52263.oliver@neukum.org> (raw)
In-Reply-To: <20040317142717.GA14149@pasky.ji.cz>


> >   After populating the hotplug scripts with plethora of debug prints,
> > I've tracked it down to usb_convert_vars() - basically, immediatelly
> > after the USB device is plugged and the signal is already delivered to
> > hotplug, the sysfs tree isn't yet populated by all the relevant data
> > and only detach_state is present there - no bDeviceClass or so.
>
> Yes, it's quite easy to race the kernel with this.  But how about
> putting the proper patch in by sitting and spinning until we see the
> file we are looking for (or erroring out after a time period.)
>
> That's much cleaner than always sleeping.  On a SMP box, you usually
> never need to sleep :)

It seems to me the proper patch would be for the kernel to wait for
the creation of any files it refers to when generating a hotplug invocation.

	Regards
		Oliver



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id\x1470&alloc_id638&op=click
_______________________________________________
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:[~2004-03-27  0:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-17 14:27 [PATCH] USB hotplug race Petr Baudis
2004-03-26 23:05 ` Greg KH
2004-03-27  0:05 ` Oliver Neukum [this message]
2004-03-27  0:12 ` 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=200403270105.52263.oliver@neukum.org \
    --to=oliver@neukum.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).