On Sat, 29 May 2004, Vojtech Pavlik wrote:

> On Sat, May 29, 2004 at 03:23:09PM +0200, Oliver Neukum wrote:
> 
> > > Here I have this patch ported from a 2.4 verison of a patch by guy at
> > > Dell ([EMAIL PROTECTED]), that uses the serialize semaphore in devio.c
> > > and in usb-storage.
> > > 
> > > This is needed on storage devices, where even sending a harmless
> > > GET_DESCRIPTOR command at the wrong time will lead to a STALL condition,
> 
> > It seems to me that you should hold the semaphore until after the reset
> > of the error case. You are dropping it too early.
>  
> Ok, how about this one?

I think it would be better to grab and release the semaphore around the
call to us->proto_handler() in usb_stor_control_thread().  It would mean
holding the semaphore a little bit longer (not much), but it would be
simpler and it would also handle the isd200 subdriver, which doesn't even
use usb_stor_invoke_transport().

However, there's a definite disadvantage to using dev->serialize for this
purpose: It can delay khubd and disconnect notifications.  usb-storage
can wait for fairly long periods, 20 or 30 seconds sometimes.  If it holds
the serialize semaphore during those times then it will block khubd if the
device is disconnected.

On the whole, it might be better to add a new mutex to struct usb_device 
to provide this sort of driver-level serialization rather than overload 
the existing mutex, which is meant to serialize actions by usbcore.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&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