diff options
author | Diana Z <dzigterman@chromium.org> | 2021-05-20 22:08:29 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-25 17:35:05 +0000 |
commit | 8a6b1b697edf18e20dd424656722ac41ef22fef6 (patch) | |
tree | 89cf027247a3f61c38b754dabae41125b40731e3 /common/usbc/usb_pe_drp_sm.c | |
parent | bd9e351d4f91c00fdb610a9522177f9e930512aa (diff) | |
download | chrome-ec-8a6b1b697edf18e20dd424656722ac41ef22fef6.tar.gz |
TCPMv2: Clear pending DPMs during port discovery request
If there is a pending VDM send during the processing of
DPM_REQUEST_PORT_DISCOVERY, then the VDM send and ACK may leave the DP
module in an inconsistent state. Avoid this state by clearing any
pending VDM sends at this time.
BRANCH=None
BUG=b:182237701
TEST=on mancomb, plug in a dock in G3 and power up to S0 repeatedly,
ensuring that we can enter DP mode every time
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I2223ed431df97821a177e9a030b53f6310a1faf8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2912114
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usbc/usb_pe_drp_sm.c')
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 1aa2b4b270..aefd656066 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -1456,13 +1456,15 @@ static bool common_src_snk_dpm_requests(int port) if (!PE_CHK_FLAG(port, PE_FLAGS_MODAL_OPERATION)) { /* * Clear counters and reset timer to trigger a - * port discovery. + * port discovery, and also clear any pending VDM send + * requests. */ pd_dfp_discovery_init(port); pe[port].dr_swap_attempt_counter = 0; pe[port].discover_identity_counter = 0; pd_timer_enable(port, PE_TIMER_DISCOVER_IDENTITY, PD_T_DISCOVER_IDENTITY); + PE_CLR_DPM_REQUEST(port, DPM_REQUEST_VDM); } return true; } else if (PE_CHK_DPM_REQUEST(port, DPM_REQUEST_VDM)) { |