Skip to content
Commit c4be61c3 authored by Jack Pham's avatar Jack Pham
Browse files

usb: pd: Avoid blocking wait in SRC_TRANSITION_TO_DEFAULT



When sending/receiving a hard reset in source mode, the
PE_SRC_TRANSITION_TO_DEFAULT state turns off VBUS/VCONN and
sleeps for 750ms. During this fairly long period any Type-C
event such as cable disconnect or reconnect won't get
processed as the workqueue is blocked by this wait condition.
This can lead to incorrect state handling, for example when
a sink is removed and a source is attached; the state machine
will think a sink is still attached. Fix this by removing
the msleep() and set a timer to restart the state machine
to PE_UNKNOWN which will turn VBUS/VCONN back on and start
again in PE_SRC_STARTUP. This frees up the workqueue to
process any potential incoming events in the meantime.

Change-Id: I282551a58252a672f319d1559eac9f4ad4c3ca8a
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent be0f20ce
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment