diff options
author | Diana Z <dzigterman@chromium.org> | 2020-06-20 22:55:32 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-27 17:56:46 +0000 |
commit | e12b6eb0af54738ccecf3d8e62660dbd8b459f99 (patch) | |
tree | 4050403976c6407082b5d6e4c78c05284fef1af1 | |
parent | 314706a15fabfea7883ff9ceb3507f631de0574d (diff) | |
download | chrome-ec-e12b6eb0af54738ccecf3d8e62660dbd8b459f99.tar.gz |
TCPMv2: Exit Attached.SRC on open even during swap
If a port doesn't clear the PR swap in progress flag while switching
from a source to a sink, the port can end up permanently stuck in
Attached.SRC even when the port partner is unplugged.
This removes the check to the PR swap in progress flag when Open is
detected on the CC lines. This follows the type-c spec's exit
conditions, and we would not expect to see CC open during a PR swap
since the source sets Rd before the new source will set Rp.
BRANCH=None
BUG=b:158613480
TEST=on mancomb, unplugging after failed PR swap with dock
allows port to go unattached again. Normal PR swap process is able to
complete with dock plus servo_v4 and Apple 3-in-1
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Idc4c193597c6b4a791d18e38bc5111d0342e512c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2256465
Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c index 2fba18a970..b15918b1bc 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -3079,8 +3079,7 @@ static void tc_attached_src_run(const int port) * AttachWait.SNK shall enter TryWait.SNK for a Sink detach from * Attached.SRC. */ - if (tc[port].cc_state == PD_CC_NONE && - !TC_CHK_FLAG(port, TC_FLAGS_PR_SWAP_IN_PROGRESS)) { + if (tc[port].cc_state == PD_CC_NONE) { bool tryWait; enum usb_tc_state new_tc_state = TC_UNATTACHED_SNK; |