From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Sat, 27 Mar 2004 00:12:17 +0000 Subject: Re: [PATCH] USB hotplug race Message-Id: <20040327001217.GA11946@kroah.com> List-Id: References: <20040317142717.GA14149@pasky.ji.cz> In-Reply-To: <20040317142717.GA14149@pasky.ji.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sat, Mar 27, 2004 at 01:05:52AM +0100, Oliver Neukum wrote: > > > > 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. Heh, yeah, that would be "nice" to have, but unfortunatly due to the way the stupid stupid stupid programmer [1] who wrote that code, it's quite difficult (if not impossible) to do... It's a 2.7 thing... thanks, greg k-h [1] yeah, it was me, go ahead, blame me, who knew hotplug would be so fast... ------------------------------------------------------- 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_id70&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