Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=756aa6b3d536afe85e151138cb03a293998887b3
Commit:     756aa6b3d536afe85e151138cb03a293998887b3
Parent:     648dcfc805ea1308552225e96113dc60e054f2f0
Author:     Christian Engelmayer <[EMAIL PROTECTED]>
AuthorDate: Wed May 30 11:04:48 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jul 12 16:34:31 2007 -0700

    ehci-hub: improved over-current recovery
    
    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 root
    hubs need port power to be cycled by software in order to get back
    to normal functionality after an over-current condition ... like
    the EHCI implementation on an MPC8343E.
    
    Signed-off-by: Christian Engelmayer <[EMAIL PROTECTED]>
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/host/ehci-hub.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index 27291f5..71aeca0 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -647,9 +647,24 @@ static int ehci_hub_control (
                        status |= 1 << USB_PORT_FEAT_C_CONNECTION;
                if (temp & PORT_PEC)
                        status |= 1 << USB_PORT_FEAT_C_ENABLE;
-               if ((temp & PORT_OCC) && !ignore_oc)
+
+               if ((temp & PORT_OCC) && !ignore_oc){
                        status |= 1 << USB_PORT_FEAT_C_OVER_CURRENT;
 
+                       /*
+                        * Hubs should disable port power on over-current.
+                        * However, not all EHCI implementations do this
+                        * automatically, even if they _do_ support per-port
+                        * power switching; they're allowed to just limit the
+                        * current.  khubd will turn the power back on.
+                        */
+                       if (HCS_PPC (ehci->hcs_params)){
+                               ehci_writel(ehci,
+                                       temp & ~(PORT_RWC_BITS | PORT_POWER),
+                                       status_reg);
+                       }
+               }
+
                /* whoever resumes must GetPortStatus to complete it!! */
                if (temp & PORT_RESUME) {
 
-
To unsubscribe from this list: send the line "unsubscribe git-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