diff options
author | Denis Brockus <dbrockus@google.com> | 2020-06-26 14:47:29 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-06-27 00:42:33 +0000 |
commit | 59750aafb68bdc10fdd327159f251c22e810ae10 (patch) | |
tree | 6c1b799c8a7e28d08353b8a3fcf9b9d5106687ae | |
parent | 99ef78447ad69b1ab0c724d51b56f69d5c6c5fef (diff) | |
download | chrome-ec-59750aafb68bdc10fdd327159f251c22e810ae10.tar.gz |
TCPMv2: Clear unhandled DPM Requests
Connecting Kohaku to Trembyle for DUT-DUT
charging was getting really chatty on attach
due to an unsupported DPM Request that was
not being cleared. This will clear the
unsupported DPM Request so only one message
will be output
BUG=b:160009733
BRANCH=none
TEST=Kohaku-Trembyle USB-C connection
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I4f4036de3c9559d9e1b175fdbeab19c00ca84c8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2270997
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | common/usbc/usb_pe_drp_sm.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 4710ced9fe..4281136a87 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -2077,6 +2077,8 @@ static void pe_src_ready_run(int port) DPM_REQUEST_SOURCE_CAP); if (pe[port].dpm_request) { + uint32_t dpm_request = pe[port].dpm_request; + PE_SET_FLAG(port, PE_FLAGS_LOCALLY_INITIATED_AMS); if (PE_CHK_DPM_REQUEST(port, DPM_REQUEST_DR_SWAP)) { @@ -2102,9 +2104,10 @@ static void pe_src_ready_run(int port) DPM_REQUEST_SEND_PING)) { PE_CLR_DPM_REQUEST(port, DPM_REQUEST_SEND_PING); set_state_pe(port, PE_SRC_PING); - } else if (!common_src_snk_dpm_requests(port)) { + } else if (!common_src_snk_dpm_requests(port)) { CPRINTF("Unhandled DPM Request %x received\n", - pe[port].dpm_request); + dpm_request); + PE_CLR_DPM_REQUEST(port, dpm_request); PE_CLR_FLAG(port, PE_FLAGS_LOCALLY_INITIATED_AMS); } @@ -2831,6 +2834,8 @@ static void pe_snk_ready_run(int port) DPM_REQUEST_SEND_PING); if (pe[port].dpm_request) { + uint32_t dpm_request = pe[port].dpm_request; + PE_SET_FLAG(port, PE_FLAGS_LOCALLY_INITIATED_AMS); if (PE_CHK_DPM_REQUEST(port, DPM_REQUEST_DR_SWAP)) { @@ -2860,7 +2865,8 @@ static void pe_snk_ready_run(int port) set_state_pe(port, PE_DR_SNK_GET_SINK_CAP); } else if (!common_src_snk_dpm_requests(port)) { CPRINTF("Unhandled DPM Request %x received\n", - pe[port].dpm_request); + dpm_request); + PE_CLR_DPM_REQUEST(port, dpm_request); PE_CLR_FLAG(port, PE_FLAGS_LOCALLY_INITIATED_AMS); } |