summaryrefslogtreecommitdiff
path: root/common/usbc/tbt_alt_mode.c
diff options
context:
space:
mode:
authorAbe Levkoy <alevkoy@chromium.org>2021-03-31 16:23:47 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-13 18:37:33 +0000
commite09b3110611a5e12de424ef62d2290c9425a37d9 (patch)
tree0ee2165a8dc6e6f635b70954bc7a33083ba55904 /common/usbc/tbt_alt_mode.c
parentd1924be854913acf1b42fc9fff9c547c947b72b7 (diff)
downloadchrome-ec-e09b3110611a5e12de424ef62d2290c9425a37d9.tar.gz
TCPMv2: Don't retry after failed alt mode entry
If entering DP or TBT alt mode fails, leave the state machine in an inactive state. Allow the DPM to see that the mode entry process is done and stop trying to send more VDMs. BUG=b:184197145,b:179443762 TEST=make buildall TEST=Pass TDA.2.1.2.1 on Voxel with AP-driven mode entry TEST=Enter, exit, and reenter DP and TBT mode with host commands BRANCH=firmware-volteer-13672.B-main Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: If72b3410f9aa174c48c65a8ca908d79e2090fa62 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798525
Diffstat (limited to 'common/usbc/tbt_alt_mode.c')
-rw-r--r--common/usbc/tbt_alt_mode.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/common/usbc/tbt_alt_mode.c b/common/usbc/tbt_alt_mode.c
index de296aa216..fdee453904 100644
--- a/common/usbc/tbt_alt_mode.c
+++ b/common/usbc/tbt_alt_mode.c
@@ -138,6 +138,11 @@ bool tbt_cable_entry_is_done(int port)
static void tbt_exit_done(int port)
{
+ /*
+ * If the EC exits an alt mode autonomously, don't try to enter it again. If
+ * the AP commands the EC to exit DP mode, it might command the EC to enter
+ * again later, so leave the state machine ready for that possibility.
+ */
tbt_state[port] = IS_ENABLED(CONFIG_USB_PD_REQUIRE_AP_MODE_ENTRY)
? TBT_START : TBT_INACTIVE;
TBT_CLR_FLAG(port, TBT_FLAG_RETRY_DONE);
@@ -385,9 +390,7 @@ void intel_vdm_naked(int port, enum tcpm_transmit_type type, uint8_t vdm_cmd)
tbt_active_cable_exit_mode(port);
else {
tbt_prints("exit mode SOP failed", port);
- tbt_state[port] =
- IS_ENABLED(CONFIG_USB_PD_REQUIRE_AP_MODE_ENTRY)
- ? TBT_START : TBT_INACTIVE;
+ tbt_state[port] = TBT_INACTIVE;
TBT_CLR_FLAG(port, TBT_FLAG_RETRY_DONE);
}
break;