Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 73e513b9 authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3: gadget: Ensure core is not suspended when handling interrupt



Commit 3fa2ffcc "usb: dwc3: gadget: Check if suspended in
dwc3_thread_interrupt" attempted to prevent unclocked core register
access by checking pm_runtime_suspended() state of the dwc3 device
and bails out if suspended. However, since clocks are handled by
the parent glue layer, the runtime suspend state of the dwc3 device
is not a reliable indicator that clocks are off and may actually cause
the thread handler to prematurely stop processing events. When that
happens, the DWC3_GEVNTCOUNT register doesn't get written to decrement
the pending event count, and the IRQ will continue to storm, resulting
in a watchdog timeout.

Revert commit 3fa2ffcc and instead fix 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.

Also add a last-chance check in dwc3_msm_suspend to make sure there
are no pending events. If there are, abort the suspend. Finally, add
some additional event logging to keep track of when suspend and threaded
interrupts happen for future debugging.

CRs-fixed: 609233
CRs-fixed: 622850
Change-Id: Ia21c9ac74d74833a889081f41c93acec2a7ae011
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 5f318d6e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment