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:
Jack Pham <jackp@codeaurora.org>
Loading
Please register or sign in to comment