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

Commit 7269ac10 authored by Jack Pham's avatar Jack Pham
Browse files

usb: dwc3-msm: Ignore multiple VBUS notifications



VBUS notifications arrive externally. There is a possibility that
they can arrive spuriously with the same value, which can cause
the resume_work function to get queued multiple times back-to-back.
This can result in the runtime PM counters getting out of sync,
For instance in the case of cable plug-in, if resume_work is called
multiple times, pm_runtime_get() is called multiply resulting in
runaway usage_counter increase. Upon cable disconnect, there would
be a mismatch in the number of times pm_runtime_put() is called
which leaves the device in a non-suspended state.

Prevent this by queuing the work function only when VBUS state
changes. Also add additional checking to the PHY_RESUME handling
such that pm_runtime_get() is not called if the usage counter is
already non-zero.

Change-Id: Ie7ac27c32e81f3c149ad7f2a64d8c8ebd0073617
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 5a0974cf
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