summaryrefslogtreecommitdiff
path: root/common/usb_pd_alt_mode_dfp.c
diff options
context:
space:
mode:
authorScott Collyer <scollyer@google.com>2021-03-08 18:04:39 -0800
committerCommit Bot <commit-bot@chromium.org>2021-03-17 19:13:42 +0000
commitef96869a8d0c587584d181cd05d331372d507b3a (patch)
tree4aaa576b4ed0f94a1d6222dbb143f587484e6580 /common/usb_pd_alt_mode_dfp.c
parent6f12cb4866278a10e08bd6dd5e8f8e77119f3063 (diff)
downloadchrome-ec-ef96869a8d0c587584d181cd05d331372d507b3a.tar.gz
TCPMv2: PE/DPM: Don't preemptively set modal flag
Currently we are setting the modal flag as a DFP when the ENTER command is being sent, without confirmation of the ACK reply from the UFP. This CL keeps this behavior for TCPMv1, but moves the setting of the modal flag into the alt mode specific state machine. Currently, we only support DP and Thunderbolt alt modes. When the modal flag is set pre-emptively, we will fail the TDA.2.2.3: BMC-PROT-SEQ-DRSWAP compliance test. This is because we trigger a hard reset if the modal flag is set and we receive a data role swap request. BUG=b:180764800,b:159946351,b:181386294 BRANCH=None TEST=Verifed that TDA.2.2.3: BMC-PROT-SEQ-DRSWAP passes on quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I4ae527903859e8ffdb01f355606c5d0f7d177def Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751329 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common/usb_pd_alt_mode_dfp.c')
-rw-r--r--common/usb_pd_alt_mode_dfp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/common/usb_pd_alt_mode_dfp.c b/common/usb_pd_alt_mode_dfp.c
index 1c683145f1..c671616da6 100644
--- a/common/usb_pd_alt_mode_dfp.c
+++ b/common/usb_pd_alt_mode_dfp.c
@@ -250,10 +250,12 @@ uint32_t pd_dfp_enter_mode(int port, enum tcpm_transmit_type type,
/*
* Strictly speaking, this should only happen when the request
* has been ACKed.
- * TODO(b/159854667): Redo setting the enter mode flag to incorporate
- * it into the DP state machine.
+ * For TCPMV1, still set modal flag pre-emptively. For TCPMv2, the modal
+ * flag is set when the ENTER command is ACK'd for each alt mode that is
+ * supported.
*/
- pd_set_dfp_enter_mode_flag(port, true);
+ if (IS_ENABLED(CONFIG_USB_PD_TCPMV1))
+ pd_set_dfp_enter_mode_flag(port, true);
/* SVDM to send to UFP for mode entry */
return VDO(modep->fx->svid, 1, CMD_ENTER_MODE | VDO_OPOS(modep->opos));