summaryrefslogtreecommitdiff
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-25 18:57:38 +0000
commit44f99c4c055974bdbb133bc092cb1c8d6e93b425 (patch)
tree08a86770e1937e2bf501b295d893e5e92d6a5fde
parente3148d18d9b36237d820e8f12f45bf751dc0b351 (diff)
downloadchrome-ec-44f99c4c055974bdbb133bc092cb1c8d6e93b425.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> (cherry picked from commit c3d56ca0232e245c1bbfd8405aef84fbf128ddca) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4472057 Commit-Queue: Chao Gui <chaogui@google.com> Reviewed-by: Chao Gui <chaogui@google.com> Tested-by: Chao Gui <chaogui@google.com>
-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