summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-04-13 20:18:22 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-15 17:58:35 +0000
commit5f0980d11eab2db0690c05f4d75dd81917fe12aa (patch)
treee856b5182c89ade2754b7a253bd8239d7126a2d3
parentb0e336029d147866898777916e0426539c0ff3da (diff)
downloadchrome-ec-5f0980d11eab2db0690c05f4d75dd81917fe12aa.tar.gz
TCPMv2: Soft reset on Vconn_Swap sequence interruption
When a non-interruptible AMS is interrupted, the unexpected message should yield a soft reset on the SOP* of the incoming message. Before sending PS_RDY, check for this condition and soft reset if necessary. BRANCH=None BUG=b:182221344 TEST=on sasuke, confirm charger can successfully connect reliably Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6612cb5d5d74cf99155cac99894a7746462a7b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2823633 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829113 Tested-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index cb32d7d2c1..674c8de527 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -6432,6 +6432,18 @@ static void pe_vcs_send_ps_rdy_swap_entry(int port)
{
print_current_state(port);
+ /* Check for any interruptions to this non-interruptible AMS */
+ if (PE_CHK_FLAG(port, PE_FLAGS_MSG_RECEIVED)) {
+ enum tcpm_transmit_type sop =
+ PD_HEADER_GET_SOP(rx_emsg[port].header);
+
+ PE_CLR_FLAG(port, PE_FLAGS_MSG_RECEIVED);
+
+ /* Soft reset with the SOP* of the incoming message */
+ pe_send_soft_reset(port, sop);
+ return;
+ }
+
/* Send a PS_RDY Message */
send_ctrl_msg(port, TCPC_TX_SOP, PD_CTRL_PS_RDY);
}