diff options
author | Diana Z <dzigterman@chromium.org> | 2019-03-26 15:27:12 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-04-15 17:51:49 -0700 |
commit | 28d6be82e967db846cbd2329a9dff48e55770cb6 (patch) | |
tree | 378eba00e94c245cdb664226065e20c07d746621 | |
parent | 15196acec9b793a4d4500f0ac659cf6e74e4ebe2 (diff) | |
download | chrome-ec-28d6be82e967db846cbd2329a9dff48e55770cb6.tar.gz |
USB PD: Suspend ports when resetting TCPCs during cold reboot
Currently, when EC cold reboots run, they reset the board's TCPC chips,
but do not communicate this fact to the PD tasks. This may lead to the
PD tasks reading register values with are incorrect or not yet
initialized. Before resetting the TCPCs, put each port into suspend to
prevent this.
BUG=b:129092057
BRANCH=octopus
TEST=Ran several EC resets as well as EC cold reboots with source and
sink partners, verified we successfully maintained connection with the
port partner without hitting contract disagreements
Change-Id: I6d509c4c6b22400b6250e2740e7927be92373802
Signed-off-by: Diana Z <dzigterman@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1538751
Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | common/system.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/common/system.c b/common/system.c index d956787e74..7b91b84eba 100644 --- a/common/system.c +++ b/common/system.c @@ -937,7 +937,15 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd) return system_run_image_copy(system_get_active_copy()); case EC_REBOOT_COLD: #ifdef HAS_TASK_PDCMD - /* Reboot the PD chip as well */ + /* + * Reboot the PD chip(s) as well, but first suspend the ports + * if this board has PD tasks running so they don't query the + * TCPCs while they reset. + */ +#ifdef HAS_TASK_PD_C0 + for (int port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) + pd_set_suspend(port, 1); +#endif board_reset_pd_mcu(); #endif |