Re: avoid resetting mode-switched devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Dec 2009, Oliver Neukum wrote:

> Am Montag, 14. Dezember 2009 23:12:06 schrieb Alan Stern:
> > On Mon, 14 Dec 2009, Oliver Neukum wrote:
> > 
> > > > Also note that other drivers will reset a device to recover from errors 
> > > > (usbhid for example).
> > > 
> > > I haven't heard of a switched device with an HID interface.
> > 
> > Eventually one will come along.
> 
> Yes, I have some code to fall back to usb_reset_configuration().
> Should we do so also for storage?

I don't think that's such a good idea.  For instance, I doubt
usb_reset_configuration() will be powerful enough to recover from the
errors usb-storage encounters.  In fact, even a port reset isn't always
powerful enough.

Also it doesn't notify drivers about the reset.  Really it was meant 
for use only with non-composite devices, where there's never more than 
one driver involved.

> > > > probably because Windows doesn't use it.  So what does Windows do when 
> > > > such a device gets an error in its mass-storage interface?
> > > 
> > > I don't know. I suspect Windows switches modes in kernel space.
> > 
> > Well, if we don't have any choice then it has to be done.  Obviously a
> > sysfs attribute is the best way.  However I can't help thinking that
> > this is only a symptom of something deeper, and it ought to be
> > generalized.  But it's not clear how...
> 
> The obvious alternative is to put mode switching into the kernel.
> If you don't want to do that, there'll be other drawbacks, we are seeing
> here.

Even if mode switching were in the kernel (and in a few cases it is),
there still would be problems.  Mode switching often involves changing
descriptors.  The core interprets these changes as meaning that the
device has disconnected and another device was plugged into the port.

Face it, mode switching is a bad idea.  These devices should have been
designed to use multiple configurations instead.  Since they weren't,
their functionality is severely compromised: It's very difficult to
reset them for error recovery.

Alan Stern

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux