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

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

usb: pd: Implement RX message queuing



Add a queue to store messages in the phy_msg_received() callback.
This eliminates the call to flush_work() and allows for more
robust handling of incoming messages especially if they arrive
while the usbpd_sm work function is in progress.

In particular this fixes a bug seen when a REQUEST message is
received just after sending a SRC_CAPABILITIES, but since there
may not be a previous message, flush_work() is not called, and the
end of usbpd_sm() overwrites pd->rx_msg_type and pd->rx_msg_len
to 0. As a result, when usbpd_sm() is run again, it will see no
message and proceed to SRC_HARD_RESET.

Change-Id: I4510f91e7d23ab161517c13702462da4ec8d7a2e
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
parent 015c20d6
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