summaryrefslogtreecommitdiff
path: root/common/usbc/usb_pe_drp_sm.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/usbc/usb_pe_drp_sm.c')
-rw-r--r--common/usbc/usb_pe_drp_sm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index aa93f1cdc3..0264837057 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -4666,6 +4666,14 @@ static void pe_drs_evaluate_swap_entry(int port)
* PE_DRS_DFP_UFP_Accept_Swap states embedded here.
*/
send_ctrl_msg(port, TCPCI_MSG_SOP, PD_CTRL_ACCEPT);
+ /*
+ * The PD spec implies that the PE transitions through
+ * PE_DRS_*_Accept_Swap and PE_DRS_Change and updates the data
+ * role instantaneously, but this PE doesn't. During the
+ * transition, do not validate the data role of incoming
+ * messages, in case the port partner transitioned faster.
+ */
+ prl_set_data_role_check(port, false);
} else {
/*
* PE_DRS_UFP_DFP_Reject_Swap and PE_DRS_DFP_UFP_Reject_Swap
@@ -4717,6 +4725,7 @@ static void pe_drs_change_run(int port)
/* Update the data role */
pe[port].data_role = pd_get_data_role(port);
+ prl_set_data_role_check(port, true);
if (pe[port].data_role == PD_ROLE_DFP)
PE_CLR_FLAG(port, PE_FLAGS_DR_SWAP_TO_DFP);