Skip to content

Commit

Permalink
EHCI: Quirk flag for port power handling on overcurrent.
Browse files Browse the repository at this point in the history
Commit 756aa6b (ehci-hub: improved
over-current recovery) added port power cycling on overcurrent indications as
needed by the MPC8349 USB controller after resolving of the overcurrent
situation in order to have the host state machine assert the correct port
status again.

Commit 81463c1 (EHCI: only power off port if
over-current is active) solved a thus resulting issue of endless overcurrent
changes in combination with the MAX4967 USB power supply chip that signals
overcurrent when power is not enabled by only powering off a port if the
overcurrent is currently active.

Added quirks flag need_oc_pp_cycle in order to specify the needed behaviour as
there is no common behaviour that can comply with both requirements.
Activated the quirks handling for Freescale 83xx based boards.

Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Christian Engelmayer authored and Greg Kroah-Hartman committed Apr 3, 2013
1 parent e7d3b6e commit e6604a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions drivers/usb/host/ehci-fsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,15 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
/* EHCI registers start at offset 0x100 */
ehci->caps = hcd->regs + 0x100;

#ifdef CONFIG_PPC_83xx
/*
* Deal with MPC834X that need port power to be cycled after the power
* fault condition is removed. Otherwise the state machine does not
* reflect PORTSC[CSC] correctly.
*/
ehci->need_oc_pp_cycle = 1;
#endif

hcd->has_tt = 1;

retval = ehci_setup(hcd);
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/host/ehci-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,8 @@ static int ehci_hub_control (
* power switching; they're allowed to just limit the
* current. khubd will turn the power back on.
*/
if ((temp & PORT_OC) && HCS_PPC(ehci->hcs_params)) {
if (((temp & PORT_OC) || (ehci->need_oc_pp_cycle))
&& HCS_PPC(ehci->hcs_params)) {
ehci_writel(ehci,
temp & ~(PORT_RWC_BITS | PORT_POWER),
status_reg);
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/host/ehci.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct ehci_hcd { /* one per controller */
unsigned use_dummy_qh:1; /* AMD Frame List table quirk*/
unsigned has_synopsys_hc_bug:1; /* Synopsys HC */
unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */
unsigned need_oc_pp_cycle:1; /* MPC834X port power */

/* required for usb32 quirk */
#define OHCI_CTRL_HCFS (3 << 6)
Expand Down

0 comments on commit e6604a7

Please sign in to comment.