diff options
author | Caveh Jalali <caveh@chromium.org> | 2019-06-12 00:59:17 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-31 07:18:25 +0000 |
commit | b0828291b501289f4c1d3726ab545cf3efd06d13 (patch) | |
tree | 0709d8d4262fbdacb6b2897b08b9e405d3ebe8c8 /include | |
parent | 85ae91a99c04bc77b9c4fd3159e04fa4e9d0af16 (diff) | |
download | chrome-ec-b0828291b501289f4c1d3726ab545cf3efd06d13.tar.gz |
pd_protocol: add hard_reset_complete_timer
certain chargers have noisy CC lines which can prevent overly
sensitive TCPCs from detecting a bus idle state. this means the TCPC
will not send out messages such as hard_reset. this condition may not
clear which means our pd_task() will retry sending hard_resets.
although we specify a "timeout" for the event loop in this state, the
timeout can be ignored by the event wait when there are pending
events. this gets us into a tight event processing loop that starves
the watchdog!
the solution is to add an explicit timeout timer when processing the
PD_STATE_HARD_RESET_SEND state.
BUG=b:134702480
BRANCH=none
TEST=no more EC watchdog on affected systems
Change-Id: I1ae871f5d8fc99f6906ddd18741bbf68dcb6e935
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1889431
Tested-by: Nitin Kolluru <nkolluru@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index c4aad508ca..0608078fe0 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -181,19 +181,21 @@ enum pd_rx_errors { #define SVID_DISCOVERY_MAX 16 /* Timers */ -#define PD_T_SINK_TX (18*MSEC) /* between 16ms and 20 */ -#define PD_T_CHUNK_SENDER_RSP (24*MSEC) /* between 24ms and 30ms */ -#define PD_T_CHUNK_SENDER_REQ (24*MSEC) /* between 24ms and 30ms */ -#define PD_T_SEND_SOURCE_CAP (100*MSEC) /* between 100ms and 200ms */ -#define PD_T_SINK_WAIT_CAP (600*MSEC) /* between 310ms and 620ms */ -#define PD_T_SINK_TRANSITION (35*MSEC) /* between 20ms and 35ms */ -#define PD_T_SOURCE_ACTIVITY (45*MSEC) /* between 40ms and 50ms */ -#define PD_T_SENDER_RESPONSE (30*MSEC) /* between 24ms and 30ms */ -#define PD_T_PS_TRANSITION (500*MSEC) /* between 450ms and 550ms */ -#define PD_T_PS_SOURCE_ON (480*MSEC) /* between 390ms and 480ms */ -#define PD_T_PS_SOURCE_OFF (920*MSEC) /* between 750ms and 920ms */ -#define PD_T_PS_HARD_RESET (25*MSEC) /* between 25ms and 35ms */ -#define PD_T_ERROR_RECOVERY (25*MSEC) /* 25ms */ +#define PD_T_SINK_TX (18*MSEC) /* between 16ms and 20 */ +#define PD_T_CHUNK_SENDER_RSP (24*MSEC) /* between 24ms and 30ms */ +#define PD_T_CHUNK_SENDER_REQ (24*MSEC) /* between 24ms and 30ms */ +#define PD_T_HARD_RESET_COMPLETE (5*MSEC) /* between 4ms and 5ms*/ +#define PD_T_HARD_RESET_RETRY (1*MSEC) /* 1ms */ +#define PD_T_SEND_SOURCE_CAP (100*MSEC) /* between 100ms and 200ms */ +#define PD_T_SINK_WAIT_CAP (600*MSEC) /* between 310ms and 620ms */ +#define PD_T_SINK_TRANSITION (35*MSEC) /* between 20ms and 35ms */ +#define PD_T_SOURCE_ACTIVITY (45*MSEC) /* between 40ms and 50ms */ +#define PD_T_SENDER_RESPONSE (30*MSEC) /* between 24ms and 30ms */ +#define PD_T_PS_TRANSITION (500*MSEC) /* between 450ms and 550ms */ +#define PD_T_PS_SOURCE_ON (480*MSEC) /* between 390ms and 480ms */ +#define PD_T_PS_SOURCE_OFF (920*MSEC) /* between 750ms and 920ms */ +#define PD_T_PS_HARD_RESET (25*MSEC) /* between 25ms and 35ms */ +#define PD_T_ERROR_RECOVERY (25*MSEC) /* 25ms */ #define PD_T_CC_DEBOUNCE (100*MSEC) /* between 100ms and 200ms */ /* DRP_SNK + DRP_SRC must be between 50ms and 100ms with 30%-70% duty cycle */ #define PD_T_DRP_SNK (40*MSEC) /* toggle time for sink DRP */ @@ -231,11 +233,11 @@ enum pd_rx_errors { #define PD_T_AME (1*SECOND) /* timeout from UFP attach to Alt Mode Entry */ /* VDM Timers ( USB PD Spec Rev2.0 Table 6-30 )*/ -#define PD_T_VDM_BUSY (100*MSEC) /* at least 100ms */ -#define PD_T_VDM_E_MODE (25*MSEC) /* enter/exit the same max */ -#define PD_T_VDM_RCVR_RSP (15*MSEC) /* max of 15ms */ -#define PD_T_VDM_SNDR_RSP (30*MSEC) /* max of 30ms */ -#define PD_T_VDM_WAIT_MODE_E (100*MSEC) /* enter/exit the same max */ +#define PD_T_VDM_BUSY (100*MSEC) /* at least 100ms */ +#define PD_T_VDM_E_MODE (25*MSEC) /* enter/exit the same max */ +#define PD_T_VDM_RCVR_RSP (15*MSEC) /* max of 15ms */ +#define PD_T_VDM_SNDR_RSP (30*MSEC) /* max of 30ms */ +#define PD_T_VDM_WAIT_MODE_E (100*MSEC) /* enter/exit the same max */ /* CTVPD Timers ( USB Type-C ECN Table 4-27 ) */ #define PD_T_VPDDETACH (20*MSEC) /* max of 20*MSEC */ |