Re: [linux-usb-devel] Re: [OOPS, usbcore, releaseintf] 2.6.0-test10-mm1

From: Oliver Neukum
Date: Wed Dec 10 2003 - 11:59:03 EST


Am Mittwoch, 10. Dezember 2003 17:49 schrieb Duncan Sands:
> On Wednesday 10 December 2003 17:20, Oliver Neukum wrote:
> > Am Mittwoch, 10. Dezember 2003 14:22 schrieb Duncan Sands:
> > > > That leads to the question of how to assure that the device doesn't go
> > > > away before usb_set_configuration is called. Perhaps
> > > > usb_set_configuration and usb_unbind_interface should be changed to
> > > > require the caller to hold the serialize lock.
> > >
> > > How about
> > >
> > > __usb_set_configuration - lockless version
> > > usb_set_configuration - locked version
> >
> > Partially done.
> > That's what the _physical version of usb_reset_device() is about.
>
> Unfortunately, usb_physical_reset_device calls usb_set_configuration
> which takes dev->serialize.

That is bad, but the solution is obvious.
All such operations need a _physical version.
At first sight this may look less elegant than some lock dropping schemes,
but it is a solution that produces obviously correct code paths with respect
to locking.

Regards
Oliver

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