tree 6abfa1d3a86f3a4f355e9dd11e6c8ee158a0202b
parent 45f23f189ca66d98b1f8b7f3d30a194d3188039d
author David Brownell <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:25 -0700
committer Greg K-H <[EMAIL PROTECTED]> Tue, 19 Apr 2005 07:39:25 -0700

[PATCH] USB: revert "fix" to usb_set_interface()

This reverts a recent change to usb_set_interface().  The change worked
around a quirk in certain devices, but doing this in usbcore creates
needless regressions for other devices.  More appropriate fixes won't
put such handling in usbcore.

Basically it's tricky to do a full software reset of USB device state, since
the devices don't all act the same.  This adds a note to the kerneldoc for
the usb_reset_configuration() call to highlight the quirk this was working
around:  endpoint data toggles not being reset.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 usb/core/message.c |   25 ++++---------------------
 1 files changed, 4 insertions(+), 21 deletions(-)

Index: drivers/usb/core/message.c
===================================================================
--- 6fadab86aec4b6dd747ebfb316396842bf1501ab/drivers/usb/core/message.c  
(mode:100644 sha1:40bdb38e7bcbade82a4a176344604947f5f2760a)
+++ 6abfa1d3a86f3a4f355e9dd11e6c8ee158a0202b/drivers/usb/core/message.c  
(mode:100644 sha1:e12c5be1e0a345f12f430b17c17669ba32ba57f6)
@@ -1133,29 +1133,10 @@
        /* prevent submissions using previous endpoint settings */
        usb_disable_interface(dev, iface);
 
-       /* 9.1.1.5 says:
-        *
-        *      Configuring a device or changing an alternate setting
-        *      causes all of the status and configuration values
-        *      associated with endpoints in the affected interfaces to
-        *      be set to their default values. This includes setting
-        *      the data toggle of any endpoint using data toggles to
-        *      the value DATA0.
-        *
-        * Some devices take this too literally and don't reset the data
-        * toggles if the new altsetting is the same as the old one (the
-        * command isn't "changing" an alternate setting).  We will manually
-        * reset the toggles when the new and old altsettings are the same.
-        * Most devices won't need this, but fortunately it doesn't happen
-        * often.
-        */
-       if (iface->cur_altsetting == alt)
-               manual = 1;
        iface->cur_altsetting = alt;
 
        /* If the interface only has one altsetting and the device didn't
-        * accept the request (or whenever the old altsetting is the same
-        * as the new one), we attempt to carry out the equivalent action
+        * accept the request, we attempt to carry out the equivalent action
         * by manually clearing the HALT feature for each endpoint in the
         * new altsetting.
         */
@@ -1202,7 +1183,9 @@
  *
  * Because this affects multiple interfaces, avoid using this with composite
  * (multi-interface) devices.  Instead, the driver for each interface may
- * use usb_set_interface() on the interfaces it claims.  Resetting the whole
+ * use usb_set_interface() on the interfaces it claims.  Be careful though;
+ * some devices don't support the SET_INTERFACE request, and others won't
+ * reset all the interface state (notably data toggles).  Resetting the whole
  * configuration would affect other drivers' interfaces.
  *
  * The caller must own the device lock.
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to