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>
This commit is contained in:
parent
b06bf2fc36
commit
30c04a7b2b
1 changed files with 0 additions and 5 deletions
|
@ -568,11 +568,6 @@ static void ipa_work_handler(struct work_struct *w)
|
||||||
d_port->sm_state = STATE_CONNECTED;
|
d_port->sm_state = STATE_CONNECTED;
|
||||||
log_event_dbg("%s: ST_INIT_EVT_HOST_READY",
|
log_event_dbg("%s: ST_INIT_EVT_HOST_READY",
|
||||||
__func__);
|
__func__);
|
||||||
} else if (event == EVT_DISCONNECTED) {
|
|
||||||
usb_gadget_autopm_put_async(d_port->gadget);
|
|
||||||
log_event_dbg("%s: ST_INIT_EVT_DISC", __func__);
|
|
||||||
log_event_dbg("%s: put_async1 = %d", __func__,
|
|
||||||
atomic_read(&gad_dev->power.usage_count));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case STATE_CONNECT_IN_PROGRESS:
|
case STATE_CONNECT_IN_PROGRESS:
|
||||||
|
|
Loading…
Add table
Reference in a new issue