Re: delay before open() works

From: Greg KH (greg@kroah.com)
Date: Sun Sep 15 2002 - 01:49:44 EST


On Sun, Sep 15, 2002 at 04:38:32PM +1000, Brad Hards wrote:
> On Sun, 15 Sep 2002 16:10, Greg KH wrote:
> > This "second" hotplug event will happen when the driver registers with
> > the "class". So for the example of the USB scanner driver, it registers
> > itself with the USB "class" to set up the file_ops structure (this is
> > done in usb_register_dev(). At that point in time, /sbin/hotplug will
> > be called again.
> This is too soon, at least for the scanner driver. Look at how much code runs
> in scanner_probe() between the fops registration and the devfs registration.
>
> Hmmm, that is probably a race anyway. Oliver?

You're right, that is a race. And is due to the historical fact that
usb_register() used to also register the fops structure at the same
time. Now that the functions are split apart, the call to
usb_register_dev() should be done at the same place as the call to
devfs_register(). Patches gladly accepted :)

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:37 EST