summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2015-07-21 14:41:59 +0800
committerPeter Chen <peter.chen@freescale.com>2015-07-21 15:43:29 +0800
commit82cfe6c31ee55e5aab1a057a5aaf853b7bb6cd07 (patch)
treebf88280d2ee614f427b2330cdbccfcc5ae7f4a7b
parent40f0d728339fb460a108bc8b133207dd5a17dda8 (diff)
MLK-11269-2 usb: chipidea: host: avoid check PORT_SUSPEND wrongly
At some situations, the ehci_bus_suspend may not set PORT_SUSPEND due to port is not enabled, so add flag ehci->bus_suspended to check if ehci_bus_suspend set PORT_SUSPEND or not. We see "ci_hdrc ci_hdrc.0: timeout waiting for SUSPEND" wrongly when plug in an unsupported usb device, in that case, the PORT_PE is cleared and bus_suspend is called. Signed-off-by: Peter Chen <peter.chen@freescale.com>
-rw-r--r--drivers/usb/chipidea/host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 80af4c22aaf9..279bc8b97242 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -508,7 +508,8 @@ static int ci_ehci_bus_suspend(struct usb_hcd *hcd)
* If a transaction is in progress, there may be a delay in
* suspending the port. Poll until the port is suspended.
*/
- if (ehci_handshake(ehci, reg, PORT_SUSPEND,
+ if (test_bit(port, &ehci->bus_suspended) &&
+ ehci_handshake(ehci, reg, PORT_SUSPEND,
PORT_SUSPEND, 5000))
ehci_err(ehci, "timeout waiting for SUSPEND\n");