summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2019-10-02 14:26:50 -0600
committerCommit Bot <commit-bot@chromium.org>2019-10-14 16:28:26 +0000
commit8e7a99e26b40ff5a8b801567d61b39b24d61db38 (patch)
treeb1d8a400e4424649d8607ae12b00bba55e7e8ea9
parentffc5335db7e1f15cd5a4d4b48932ad7054a3315e (diff)
downloadchrome-ec-8e7a99e26b40ff5a8b801567d61b39b24d61db38.tar.gz
usbc: go to hard reset after noResponseTimer
We should transition to the hard reset state after the noResponseTimer expires without getting a single PD response from a port partner until we reach the hard reset count. BRANCH=none BUG=none TEST=builds Change-Id: Iaee53369dec863ed8220b9f4ffed5f252cf08c4d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837997 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index ac9e4883e1..4b3272e25e 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -1160,9 +1160,10 @@ static void pe_src_send_capabilities_run(int port)
* 3) And the HardResetCounter > nHardResetCount.
*/
if (pe[port].no_response_timer > 0 &&
- get_time().val > pe[port].no_response_timer &&
- pe[port].hard_reset_counter > N_HARD_RESET_COUNT) {
- if (PE_CHK_FLAG(port, PE_FLAGS_PD_CONNECTION))
+ get_time().val > pe[port].no_response_timer) {
+ if (pe[port].hard_reset_counter <= N_HARD_RESET_COUNT)
+ set_state_pe(port, PE_SRC_HARD_RESET);
+ else if (PE_CHK_FLAG(port, PE_FLAGS_PD_CONNECTION))
set_state_pe(port, PE_WAIT_FOR_ERROR_RECOVERY);
else
set_state_pe(port, PE_SRC_DISABLED);