summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2023-04-11 13:38:35 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-13 19:53:05 +0000
commitc3d56ca0232e245c1bbfd8405aef84fbf128ddca (patch)
tree74b58b0ce7a0e2eeaf89164bcef49369212e9156 /common
parentf4023abb261000c1df6946f026f8df5dfccd64c4 (diff)
downloadchrome-ec-c3d56ca0232e245c1bbfd8405aef84fbf128ddca.tar.gz
TCPMv2: Disable PE during ErrorRecovery
If ErrorRecovery was requested from the TC layer, ensure that the TC layer also disables the PE layer. Otherwise, the PE states may continue to progress while we're holding Open on the CC lines. Consolidate calls to disable PD messages into the tc_detached() function, which already handles the general necessities of getting the port cleaned up. BRANCH=None BUG=b:276837557 TEST=on skyrim, run some dead battery boots and observe we don't have any instances of sending a Request while in ErrorRecovery Change-Id: I8bd23ff8824b32e3895fe6e71f314aa6f0bc4127 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4416460 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c3
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 6690fff25b..a43a9ffa2a 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -731,6 +731,7 @@ static void tc_detached(int port)
{
TC_CLR_FLAG(port, TC_FLAGS_TS_DTS_PARTNER);
hook_notify(HOOK_USB_PD_DISCONNECT);
+ tc_enable_pd(port, 0);
tc_pd_connection(port, 0);
tcpm_debug_accessory(port, 0);
set_ccd_mode(port, 0);
@@ -2255,7 +2256,6 @@ static void tc_unattached_snk_entry(const int port)
#ifdef CONFIG_USB_PE_SM
CLR_FLAGS_ON_DISCONNECT(port);
- tc_enable_pd(port, 0);
tc[port].ps_reset_state = PS_STATE0;
#endif
}
@@ -2806,7 +2806,6 @@ static void tc_unattached_src_entry(const int port)
#ifdef CONFIG_USB_PE_SM
CLR_FLAGS_ON_DISCONNECT(port);
- tc_enable_pd(port, 0);
tc[port].ps_reset_state = PS_STATE0;
#endif