Re: avoid resetting mode-switched devices

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

 



On Wed, 16 Dec 2009, Oliver Neukum wrote:

> Am Dienstag, 15. Dezember 2009 16:42:54 schrieb Alan Stern:
> > On Tue, 15 Dec 2009, Oliver Neukum wrote:
> > 
> > > Am Montag, 14. Dezember 2009 23:12:06 schrieb Alan Stern:
> 
> > > 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.
> 
> True, but we cannot do a port reset for such devices.

Are you certain?  Does the mode-switch state get reset along with 
everything else?  Or does the device remain in the same mode until a 
power cycle?

> > 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.
> 
> Yes, we'd need an extended version that calls pre/post_reset.
> I am attaching the stuff I wrote before I looked closely at the
> reset logic.

This really is too much complication.  We shouldn't need multiple ways 
to reset a device.  (And if we do, they should share more code.)

> > 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.
> 
> We'd have to save copies of descriptors in both modes, compare,
> initiate a reswitch and wait for it. Extremely ugly.

Yes indeed.  Much more trouble than it is worth, IMO.

> > 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.
> 
> I do face it. I am asking whether the unease you feel is due to sucking
> hardware or have I overlooked something?

It's the hardware.

The new quirk is acceptable, but I don't like 
usb_multiple_reset_configuration().

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