[PATCH] USB: sl811-hcd: Fix device disconnect

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

 



A while ago I provided a patch that fixed device detection after device removal.
(USB: sl811-hcd: Fix device disconnect)
Chris Brissette pointed out that the detection/removal counter method
to distinguish insert or remove my fail under certain conditions.
Latest SL811HS datasheet (Document 38-08008 Rev. *D) indicates that
bit 6 (SL11H_INTMASK_RD) of the Interrupt Status Register together with
bit 5 (SL11H_INTMASK_INSRMV) can be used to determine whether a device has
been inserted or removed.

Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>

drivers/usb/host/sl811-hcd.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
index 5b22a4d..30f4185 100644
--- a/drivers/usb/host/sl811-hcd.c
+++ b/drivers/usb/host/sl811-hcd.c
@@ -719,10 +719,11 @@ retry:
                /* port status seems weird until after reset, so
                 * force the reset and make khubd clean up later.
                 */
-               if (sl811->stat_insrmv & 1)
-                       sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION;
-               else
+               if (irqstat & SL11H_INTMASK_RD)
+
                        sl811->port1 &= ~(1 << USB_PORT_FEAT_CONNECTION);
+               else
+                       sl811->port1 |= 1 << USB_PORT_FEAT_CONNECTION;

                sl811->port1 |= 1 << USB_PORT_FEAT_C_CONNECTION;


------------------------------------------------------------------
********* Analog Devices GmbH              Open Platform Solutions
**  *****
**     ** Wilhelm-Wagenfeld-Strasse 6
**  ***** D-80807 Munich
********* Germany
Registergericht München HRB 40368,  Geschäftsführer: Thomas Wessel, William A. Martin, Margaret K. Seif

--
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