diff options
author | Hemant Kumar <hemantk@codeaurora.org> | 2017-03-17 14:02:00 -0700 |
---|---|---|
committer | Hemant Kumar <hemantk@codeaurora.org> | 2017-03-17 14:24:23 -0700 |
commit | 5c3153dc84c39dc8ed55243298fa154509d93325 (patch) | |
tree | 9989a2b5dcda1ce19fd765c6f55c17c2e3811524 /drivers/usb/host | |
parent | 51740526b9b90ef772ba2c3c6b288f0d1688bb10 (diff) |
usb: core: Enable xhci irq after starting controller
There is a possibility of port change event triggering
xhci irq as soon as halt bit is cleared in xhci_start().
As a result before xhci state is changed from XHCI_STATE_HALTED
to 0 port change event keeps on generated until port status is
acknowledged. This does not allow xhci_start() to finish and handle
the port change event if irq is keep on getting fired on same core
where xhci_start() is running. Fix this issue by disabling irq before
starting controller and enable it back after clearing halt bit.
Change-Id: I798620f99a7ba522258455642e6e8091ebf2cd34
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8c6bb15ef51f..d1ae8edf5fb2 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -138,7 +138,13 @@ static int xhci_start(struct xhci_hcd *xhci) { u32 temp; int ret; + struct usb_hcd *hcd = xhci_to_hcd(xhci); + /* + * disable irq to avoid xhci_irq flooding due to unhandeled port + * change event in halt state, as soon as xhci_start clears halt bit + */ + disable_irq(hcd->irq); temp = readl(&xhci->op_regs->command); temp |= (CMD_RUN); xhci_dbg_trace(xhci, trace_xhci_dbg_init, "// Turn on HC, cmd = 0x%x.", @@ -159,6 +165,8 @@ static int xhci_start(struct xhci_hcd *xhci) /* clear state flags. Including dying, halted or removing */ xhci->xhc_state = 0; + enable_irq(hcd->irq); + return ret; } |