summaryrefslogtreecommitdiff
path: root/common/usbc
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2021-04-21 11:26:54 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-30 00:22:15 +0000
commitf406a9065d0750621375c7198cfea459a7a78b95 (patch)
tree5da72a3f737681d8abfcc1d839c3627457106ffa /common/usbc
parent8fcfef34ffed806a042f6b0ddbf06b7b96caf1bd (diff)
downloadchrome-ec-f406a9065d0750621375c7198cfea459a7a78b95.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>
Diffstat (limited to 'common/usbc')
-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 94cef6a0d5..1346f0fd9f 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);
}