diff options
author | Eric Herrmann <eherrmann@chromium.org> | 2021-03-02 17:42:52 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-08-25 17:17:46 +0000 |
commit | a1f2b64e4abe33c6480800498248d6d10a8df7b3 (patch) | |
tree | 48883e33a1b8d0b5bfd14dc19dd206f1c5d72148 | |
parent | 43bc54f1670c5a3242ec03bf0186ac2473a44a91 (diff) | |
download | chrome-ec-a1f2b64e4abe33c6480800498248d6d10a8df7b3.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, b:196936523
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>
(cherry picked from commit 698193fa224863758f2fa74828b10773b295b38c)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116357
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@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 e1fdaf48d0..8cc15c7d4b 100644 --- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c +++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c @@ -3431,9 +3431,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); |