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

Commit d096830d authored by Manu Gautam's avatar Manu Gautam
Browse files

usb: gadget: u_bam_data: Fix UDC entering LPM before suspend finishes



In case of RNDIS, start callback from IPA triggers connect_w. If it is
delayed then we may end up having suspend_w run before connect_w.
Current suspend_w implementation results pm_runtime_get but as connect_w
didn't start, UDC is put into LPM before suspend sequence finishes. One
manifestation of this is that UDC suspend routine fails to setup USB2
PHY wakeup settings correctly as B_PERIPHERAL_SUSPEND or device_suspend
is not yet marked TRUE. This results in device failing to exit LPM on
host initiated RESUME after SUSPEND.
In this scenario, connect_w may or may not at all start if cable gets
disconnected or if host changes configuration e.g. RNDIS --> MBIM
To handle this don't do runtime_put as there was no _get yet, and
detect this condition on disconnect to not do extra pm_runtme_get
for CONNECT --> SUSPEND --> DISCONNECT scenario.

Change-Id: I7268be5ae0242772c9644baf3925edb0a3022979
Signed-off-by: default avatarManu Gautam <mgautam@codeaurora.org>
parent 23eab882
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