On Fri, Dec 13, 2002, Oliver Neukum <[EMAIL PROTECTED]> wrote:
>
> > > usb_hub_port_connect_change() should drop the semaphore
> > > before usb_new_device(). How to do that? Is doing usb_new_device
> > > several times really necessary?
> >
> > The semaphore protects the bus for the 0 address. We could either move
> > obtaining the sempahore into usb_new_device(), or move the
> > usb_set_address() call into usb_hub_port_connect_change().
> >
> > I think we should move the semaphore into usb_new_device() and
> > usb_reset_device() into usb.c.
>
> Isn't usb_new_device() too late ? It seems to me that the critical section
> starts here:
> /* Reset the device */
> if (usb_hub_port_reset(hub, port, dev, delay)) {
> usb_free_dev(dev);
> break;
> }
Ahh, good point. It needs to be grabbed in the hub driver atleast.
> IMHO till usb_set_address() is the hub driver's job.
I always thought of that as the core's job. The core chooses the address
and IMHO should program it too.
However, that won't work because of the locking that you pointed out.
The hub is the best place to move it then.
I'll create a patch when I get home and have a chance to test it.
JE
-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel