diff options
author | Abe Levkoy <alevkoy@chromium.org> | 2020-12-07 09:54:48 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-08 17:48:24 +0000 |
commit | 9760abbefee06a7ffa214dd477665b8c9476061e (patch) | |
tree | 1d74132141f4b3d251a319737b79c6dbb3dd299b | |
parent | 51626bb2855a09d63382b59a556ffeb1b79745b6 (diff) | |
download | chrome-ec-stabilize-13654.B-master.tar.gz |
TCPMv2: Fix Soft Reset logicstabilize-13654.B-master
BUG=b:173025773,b:173025737,b:155181980
TEST=Observe Soft Reset after not receiving GoodCRC 3 times
BRANCH=firmware-volteer-13521.B-master
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Iee7016549a8a83b21d0a7ca168ace7ea2594a594
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578199
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index a947ae3da5..b0b06313ce 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -1233,14 +1233,23 @@ void pe_report_error(int port, enum pe_error e, enum tcpm_transmit_type type) * See section 8.3.3.4.1.1 PE_SRC_Send_Soft_Reset State: * * The PE_Send_Soft_Reset state shall be entered from - * any state when a Protocol Error is detected by - * Protocol Layer during a Non-Interruptible AMS or when - * Message has not been sent after retries. When an explicit - * contract is not in effect. Otherwise go to PE_Snk/Src_Ready - */ - if (!PE_CHK_FLAG(port, PE_FLAGS_EXPLICIT_CONTRACT) && - (!PE_CHK_FLAG(port, PE_FLAGS_INTERRUPTIBLE_AMS) - || (e == ERR_TCH_XMIT))) { + * any state when + * * A Protocol Error is detected by Protocol Layer during a + * Non-Interruptible AMS or + * * A message has not been sent after retries or + * * When not in an explicit contract and + * * Protocol Errors occurred on SOP during an Interruptible AMS or + * * Protocol Errors occurred on SOP during any AMS where the first + * Message in the sequence has not yet been sent i.e. an unexpected + * Message is received instead of the expected GoodCRC Message + * response. + */ + /* All error types besides transmit errors are Protocol Errors. */ + if ((e != ERR_TCH_XMIT && + !PE_CHK_FLAG(port, PE_FLAGS_INTERRUPTIBLE_AMS)) + || e == ERR_TCH_XMIT + || (!PE_CHK_FLAG(port, PE_FLAGS_EXPLICIT_CONTRACT) && + type == TCPC_TX_SOP)) { pe_send_soft_reset(port, type); } /* |