usb: gadget: Handle disconnect correctly during composition switch.
If cable is disconnected early during composition switch
android_disable calls the gadget pullup op which on clearing
run/stop bit does a pm_runtime_put_noidle on the dwc3 device.
This decrements the power usage count on the dwc3 device, but the
child count of the parent mdwc3 device is not decremented.
Upon disconnect handling in the DWC3 state machine,
pm_runtime_put_sync on mdwc3 parent returns EBUSY due to child count
not being 0. As a result runtime idle does not kick in and
prevents low power mode handler being invoked.
Fix this by changing the pm_runtime_put_noidle call to
pm_runtime_put_autosuspend on dwc3 device so that the child
count for the mdwc3 parent is decremented to 0.
CRs-Fixed: 980113
Change-Id: Ibb19188c4230a08bbdef72af7de066735e8c2d67
Signed-off-by:
Devdutt Patnaik <dpatnaik@codeaurora.org>
Loading
Please register or sign in to comment