On Fri, 16 Jan 2004, Greg KH wrote:

> On Fri, Jan 16, 2004 at 06:54:58PM +0100, Oliver Neukum wrote:
> > 
> > It kills error handling in the storage driver.
> 
> So what does the storage driver really want to do?  Reset the device?
> Why, because some unknown error has happened or something else?
> 
> I can see why enumerating the whole device in this situation would be
> bad, but I really don't see how starting over with the device would be
> helpful either.

I'm going to send a longer response to your original message, but let me 
answer this question first.

The reason for doing a device reset is that it's a last-resort means of
error recovery.  If everything else fails, we do our best to reset the
whole device.  (Turning off power to the port would be even better, but we
don't have an API for that.)  In fact, USB traces show that Windows
doesn't use the less-drastic class reset command, it just goes ahead and
does a port reset.

Problems arise with devices that have more than one interface.  If one of 
the drivers decides to reset the device, the driver for the other 
interface won't know what hit it.

You seem to be suggesting that we could unbind the other driver before the
reset and then rebind it afterwards.  That at least would give it a chance
to reinitialize its part of the device.

But this won't work if that other interface is a mass storage device. The
reason is that when the disconnect occurs, the corresponding SCSI device
(/dev/sda or whatever) is permanently unbound.  Even when the driver
rebinds, it will create a new SCSI device instead of reconnecting to the
old one.  (This policy came by express direction from Linus.)  Any mounted
filesystems or open files will be damaged.  All that can be avoided if the
driver is notified that a reset is coming up and is not disconnected.

Alan Stern



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to