Revert "usb: gadget: gsi: Decrement USB gadget pm usage count on cable disconnect"
'commit
3a7ce1db5661 ("usb: gadget: gsi: Decrement USB gadget pm usage
count on cable disconnect")' added decrementing USB gadget device's pm
usage count from STATE_INITIALIZED which results into multiple time
decrementing USB gadget device's pm usage count on USB cable disconnect
as below:
1. On USB cable disconnect, USB bus suspend event is being received which
post EVT_DISCONNECTED. If state is STATE_CONNECTED, ipa_work_handles()
decrements USB gadget device's pm usage count, and move state to
STATE_INITIALIZED.
2. Due to USB cable disconnect, gsi_disable() posts EVT_DISCONNECTED.
This event is processed into STATE_CONNECTED causing additional decrement
of USB gadget device's pm usage count.
Due to above case, USB goes into low power mode with dwc3's pm usage
count negative. On connecting USB host mode cable, xhci resume is failing
due to dwc3's (parent of xhci) is having negative usage count which results
into no USB host mode functionality (pm_runtime_get_sync() returns -EBUSY).
Hence revert commit to allow USB Host mode functionality.
CRs-Fixed:
1020388
Change-Id: I853aba1d2d03945ee49adde7f0ea483cd406ce2b
Signed-off-by: Mayank Rana <mrana@codeaurora.org>