[PATCH 2.6.21.3 1/1] ehci-hub: improved over-current recovery

"Christian Engelmayer" <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <000c01c7a238$78209ce0$8200a8c0@tara>
From: Christian Engelmayer <[email protected]>

According to the USB Specification Revision 2.0 chapter 11.12.5
a hub experiencing an over-current condition must place all
affected ports in the powered-off state. It seems that some hubs
violate this requirement, but need port power to be cycled by
software in order to get back to normal functionality after an
over-current condition.

Signed-off-by: Christian Engelmayer <[email protected]>
Signed-off-by: David Brownell <[email protected]>

---
This fix was tested on an MPC8343E.

--- a/drivers/usb/host/ehci-hub.c.orig	2007-05-29 21:30:35.000000000 +0200
+++ b/drivers/usb/host/ehci-hub.c	2007-05-29 21:39:48.000000000 +0200
@@ -389,6 +389,20 @@ ehci_hub_status_data (struct usb_hcd *hc
 			    buf [1] |= 1 << (i - 7);
 			status = STS_PCD;
 		}
+
+		/*
+		 * The hub was supposed to disable port power autonomously
+		 * on over-current. However, not all hubs can be trusted to
+		 * do this although they need port power disabled in order
+		 * to recover properly.
+		 */
+		if (temp & PORT_OCC) {
+			if (HCS_PPC(ehci->hcs_params)){
+				temp &= ~(PORT_RWC_BITS | PORT_POWER);
+				writel (temp, &ehci->regs->port_status [i]);
+			}
+		}
+
 	}
 	/* FIXME autosuspend idle root hubs */
 	spin_unlock_irqrestore (&ehci->lock, flags);


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.