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

Skip to content
Commit 074daedc authored by Pratham Pratap's avatar Pratham Pratap
Browse files

usb: pd: Avoid double queue of usbpd_sm work



PD state transitions call kick_sm which can either queue the
workqueue immediately or with some delay. Both phy_msg_received()
and psy_changed() also call this when receiving a message or
Type-C event. But there is a possibility that usbpd_sm is already
executing due to a previous state transition and hence an extra
queue_work() is called from these events. If the next transition
has a deliberate delay such as waiting for SENDER_RESPONSE_TIME,
the delay is effectively eliminated and usbpd_sm gets executed
immediately again which can cause the state machine to think that
timeout occurred and will result in soft or hard reset. Avoid this
by adding a work_busy check for usbpd_sm work so that is is not
queued twice without any delay.

Change-Id: I9d5f478e8e0abe5609c80979b3158db16373dc52
Signed-off-by: default avatarPratham Pratap <prathampratap@codeaurora.org>
parent 5ddc46af
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