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

Skip to content
Commit 66a28a88 authored by Rohith Kollalsi's avatar Rohith Kollalsi Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: Resume the controller before setting device active in sm_work



Driver core invokes runtime PM idle after the device is probed. When the
runtime idle callback returns 0, platform bus proceed to runtime suspend.
If this races with state machine work which marks the runtime state as
active and enables runtime PM, there is a possibility that the runtime
PM thinks device is suspended. Because the runtime PM suspend patch
returns simply because in_lpm is true. Now, state machine work calls
dwc3_msm_resume() which sets WAIT_FOR_LPM flag hoping that it would be
cleared while runtime suspend happens via pm_runtime_put_sync(). Though
the device is in resume state, runtime PM core thinks it is suspended
due to the race mentioned above. The fact that WAIT_FOR_LPM is set,
state machine for ever stuck in DRD_STATE_IDLE waiting for this flag to
be cleared.

Fix this by calling dwc3_msm_resume before setting device as active so
that the corresponding pm_runtime_put_sync operation happens correctly.

Change-Id: I3ee58ca01d2afdf169b1f52816d7d4d448cbf8e6
Signed-off-by: default avatarRohith Kollalsi <quic_rkollals@quicinc.com>
parent 70d4bf5f
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