diff options
author | Eric Herrmann <eherrmann@chromium.org> | 2021-03-02 17:42:52 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-03 18:41:30 +0000 |
commit | 698193fa224863758f2fa74828b10773b295b38c (patch) | |
tree | 0fc105d7d4df8616644b38ba6d2f3cb6bc3d311f | |
parent | d0e0c4fa5db291bd37fdd6ce2388ec0637620f68 (diff) | |
download | chrome-ec-698193fa224863758f2fa74828b10773b295b38c.tar.gz |
TCPMv2: Don't cflush in CC_OPEN with battery
In the TC state machine, on entry to CC_OPEN we disable vbus/vconn,
print a message, flush the console, then disable CC.
But this takes too long to meet the tProtErrHardReset, which causes some
compliance failures. The main culprit is the console flush. The
justification for the console flush is that we may brown out, so this
isn't necessary when we have a battery.
Only do the console flush on entry to CC_OPEN when we don't have a
battery.
BUG=b:181053528
TEST=Compliance test TD.PD.FRSISNK3.E3 on Voxel
BRANCH=None
Signed-off-by: Eric Herrmann <eherrmann@chromium.org>
Change-Id: Ia056f3c3010737e18c02a7a80659da201cfe5f92
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2730630
Reviewed-by: Diana Z <dzigterman@chromium.org>
-rw-r--r-- | common/usbc/usb_tc_drp_acc_trysrc_sm.c | 10 |
1 files changed, 8 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 f49783f74e..82f8f001b5 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -3649,9 +3649,15 @@ static void tc_cc_open_entry(const int port) if (battery_is_present()) tcpm_enable_auto_discharge_disconnect(port, 0); - /* We may brown out after applying CC open, so flush console first. */ + /* + * We may brown out after applying CC open, so flush console first. + * Console flush can take a long time, so if we aren't in danger of + * browning out, don't do it so we can meet certain compliance timing + * requirements. + */ CPRINTS("C%d: Applying CC Open!", port); - cflush(); + if (!battery_is_present()) + cflush(); /* Remove terminations from CC */ typec_select_pull(port, TYPEC_CC_OPEN); |