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-14 21:37:23 +0000
commitfd16f618fa1e34a8c007f6a66a1ff4c9e9ef0424 (patch)
tree78ac293c8ba53c97539fbc54bc337b2e44113ceb
parent3b24719d7ad5616b4611abdd735dd8a84e7a6b5d (diff)
downloadchrome-ec-fd16f618fa1e34a8c007f6a66a1ff4c9e9ef0424.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>
-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 e2724cf98c..2dc4649fe3 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -6433,6 +6433,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);
}