diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2022-03-23 11:02:05 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-12 07:41:01 +0000 |
commit | 14b984a74aa5c707bd303e553c9b65c78ed92bf7 (patch) | |
tree | b8cab5240b45adfde9ea57288c498c68fdc33fa0 | |
parent | 1478234bc94d96b9b10c7ab8ac856b5f91c0b90d (diff) | |
download | chrome-ec-14b984a74aa5c707bd303e553c9b65c78ed92bf7.tar.gz |
usb-pe: set FRS and AMS flags before invalidte contract
Ensure the flags can be carried into the
pe_invalidate_explicit_contract.
BUG=b:223086905
TEST=Kingler C1 FRS with RT1718S TCPC works
BRANCH=none
Change-Id: Ia7d1c4697f7447945f2de53118d6f8668a2edbce
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544747
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index aa7812bbed..defeebecfa 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -5020,14 +5020,18 @@ __maybe_unused static void pe_frs_snk_src_start_ams_entry(int port) print_current_state(port); - /* Contract is invalid now */ - pe_invalidate_explicit_contract(port); - /* Inform Protocol Layer this is start of AMS */ PE_SET_FLAG(port, PE_FLAGS_LOCALLY_INITIATED_AMS); /* Shared PRS/FRS code, indicate FRS path */ PE_SET_FLAG(port, PE_FLAGS_FAST_ROLE_SWAP_PATH); + + /* + * Invalidate the contract after the FRS flags set so the + * flags can be propagated to this function. + */ + pe_invalidate_explicit_contract(port); + set_state_pe(port, PE_PRS_SNK_SRC_SEND_SWAP); } |