summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-04-21 11:26:54 -0600
committerCommit Bot <commit-bot@chromium.org>2021-05-04 18:05:53 +0000
commit39c79ce3b71a5b864be0fcf02ec7d16306461857 (patch)
treec6d0f8a87f5c03ade7a1aec256b8396438ad51e0
parentc08a4f19644bc3cc57b325e027bfa3eeac17a37b (diff)
downloadchrome-ec-39c79ce3b71a5b864be0fcf02ec7d16306461857.tar.gz
TCPMv2: Set CC on contract invalidation only if connected
When a contract is invalidated, it's important we advertise our current limit Rp rather than a residual collision avoidance Rp. However, we should not attempt to set CC's when we're in a disconnected state. This may cause us to set an unexpected CC selection, such as Ra if the TC layer hasn't set the first termination yet. BRANCH=None BUG=b:183182447 TEST=on guybrush, boot with i2c tracing enabled and ensure Ra is never set during init. Perform PR swaps and hard resets as source to ensure correct Rp is set. Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I8fbe06685e4b4a6493dfbf55270ce3bda8cfbdfd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845013 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2871048 Tested-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 1d7600a49e..f16b407998 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -955,8 +955,8 @@ void pe_invalidate_explicit_contract(int port)
PE_CLR_FLAG(port, PE_FLAGS_EXPLICIT_CONTRACT);
- /* Set Rp for current limit */
- if (IS_ENABLED(CONFIG_USB_PD_REV30))
+ /* Set Rp for current limit if still attached */
+ if (IS_ENABLED(CONFIG_USB_PD_REV30) && pd_is_connected(port))
typec_update_cc(port);
}