summaryrefslogtreecommitdiff
path: root/common/usbc/usb_pe_drp_sm.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-02-04 17:37:29 -0800
committerCommit Bot <commit-bot@chromium.org>2021-05-27 09:16:49 +0000
commit01f77c9f69dc22c9bbd4d1a01f3954f29fd5adb0 (patch)
tree219af4e9b62dae9618c59b28d0e6226b9efc50d1 /common/usbc/usb_pe_drp_sm.c
parentebc24d5a67eb0101f31334cf211f6cdf8d84f57a (diff)
downloadchrome-ec-01f77c9f69dc22c9bbd4d1a01f3954f29fd5adb0.tar.gz
TCPMv2: PE: Don't set AMS flag unless custom VDM has a reply
This CL fixes an issue related to PE_FLAGS_INTERRUPTIBLE_AMS which was being set in pe_handle_custom_vdm_request_entry whether the custom VDM request is supported or not. This would result in PE_FLAGS_INTERRUPTIBLE_AMS remaining set and ignoring of subsequent VDM messages, which in turn prevents ALT-DP entry for UFP case. BUG=b:189293176 BRANCH=quiche TEST=Verfied that with this fix, ALT-DP mode is entered consistently. Without this CL, ALT-DP mode is not entered correctly. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I7a52a6028ea656d9a1970fea0b42f582f1aaff5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677707 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common/usbc/usb_pe_drp_sm.c')
-rw-r--r--common/usbc/usb_pe_drp_sm.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index aefd656066..b819e9abfa 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -156,7 +156,8 @@
/* Message flags which should not persist on returning to ready state */
#define PE_FLAGS_READY_CLR (PE_FLAGS_LOCALLY_INITIATED_AMS \
| PE_FLAGS_MSG_DISCARDED \
- | PE_FLAGS_VDM_REQUEST_TIMEOUT)
+ | PE_FLAGS_VDM_REQUEST_TIMEOUT \
+ | PE_FLAGS_INTERRUPTIBLE_AMS)
/*
* Combination to check whether a reply to a message was received. Our message
@@ -5083,11 +5084,12 @@ static void pe_handle_custom_vdm_request_entry(int port)
memcpy(tx_emsg[port].buf, (uint8_t *)rdata, tx_emsg[port].len);
send_data_msg(port, sop, PD_DATA_VENDOR_DEF);
} else {
- if (prl_get_rev(port, TCPC_TX_SOP) > PD_REV20)
+ if (prl_get_rev(port, TCPC_TX_SOP) > PD_REV20) {
set_state_pe(port, PE_SEND_NOT_SUPPORTED);
- else
+ } else {
+ PE_CLR_FLAG(port, PE_FLAGS_INTERRUPTIBLE_AMS);
pe_set_ready_state(port);
- return;
+ }
}
}