diff options
| author | Jack Pham <jackp@codeaurora.org> | 2014-02-13 18:33:50 -0800 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:06:21 -0700 |
| commit | 0b937c189f0218bcbee4ceeec090d43237e93b13 (patch) | |
| tree | 81b705623f8f84ecc82f59be3afccb050416dd7e | |
| parent | 88f0a435936cbe509b29b801e83cab2b75020e30 (diff) | |
usb: dwc3: gadget: Ensure core is not suspended when handling interrupt
Since dwc3_thread_interrupt is part of interrupt handling that
can be scheduled to run in thread context, it leaves open a
window in which the controller might be placed into low power
mode. In this state, clocks would be disabled, and by the time
dwc3_thread_interrupt runs, would result in an unclocked I/O
access when it tries to write to the GEVNTCOUNT register.
Prevent this by calling pm_runtime_get() in dwc3_interrupt() in
order to force the device to remain in active state, which
increments the parent device's child count so that it too is
prevented from entering suspend. Call pm_runtime_put() at the
end of dwc3_thread_interrupt() after finishing processing the
event buffers.
CRs-fixed: 609233
CRs-fixed: 622850
Change-Id: Ia21c9ac74d74833a889081f41c93acec2a7ae011
Signed-off-by: Jack Pham <jackp@codeaurora.org>
| -rw-r--r-- | drivers/usb/dwc3/gadget.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 688cf1c60e72..95d9de5c2832 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -2755,6 +2755,7 @@ static irqreturn_t dwc3_thread_interrupt(int irq, void *_dwc) spin_unlock_irqrestore(&dwc->lock, flags); + pm_runtime_put(dwc->dev); return ret; } @@ -2796,6 +2797,9 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc) ret = status; } + if (ret == IRQ_WAKE_THREAD) + pm_runtime_get(dwc->dev); + return ret; } |
