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 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]> --- Reason for updating this patch: I think I made a mistake doing the change in ehci_hub_status_data() and I think that should be better done in ehci_hub_control(). Forcing port power down a bit later when the hub driver retrieves the port status information has got the advantage that it also catches the case when an OC fault occurs during booting up the board. Doing it in ehci_hub_status_data() bears the risk that the OCC is not recognized as it was already acked by the hub code when scanning ports at initialization and it would need a second OCC to get back to live by chance. --- a/drivers/usb/host/ehci-hub.c.orig 2007-06-08 15:33:16.000000000 +0200 +++ b/drivers/usb/host/ehci-hub.c 2007-06-08 18:35:20.000000000 +0200 @@ -552,8 +552,23 @@ 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) { ------------------------------------------------------------------------- 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/ _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel