OSDN Git Service

Revert "usb: gadget: gsi: Decrement USB gadget pm usage count on cable disconnect"
authorMayank Rana <mrana@codeaurora.org>
Fri, 27 May 2016 18:05:13 +0000 (11:05 -0700)
committerKyle Yan <kyan@codeaurora.org>
Wed, 1 Jun 2016 22:23:52 +0000 (15:23 -0700)
commit30c04a7b2bc708c386a16bc470a9228e0f61b413
tree5f6cae0f12edb1e2a85569dfdeb4303a042aec38
parentb06bf2fc3689870d79acf99164eed0b4f810879f
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>
drivers/usb/gadget/function/f_gsi.c