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:
Rohith Kollalsi <quic_rkollals@quicinc.com>
Loading
Please register or sign in to comment