> > > > __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.

Hi Oliver, I agree, except that there are several layers of locking: dev->serialize
but also the bus rwsem.  So does "physical" mean no subsys.rwsem or no
dev->serialize or both?

Ciao, Duncan.

int usb_reset_device(struct usb_device *udev)
{
        struct device *gdev = &udev->dev;
        int r;

        down_read(&gdev->bus->subsys.rwsem);
        r = usb_physical_reset_device(udev);
        up_read(&gdev->bus->subsys.rwsem);

        return r;
}


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to