From cbacb3e5d0df3df0345b1a4a3462d997310340db Mon Sep 17 00:00:00 2001 From: Scott Collyer Date: Sun, 20 Nov 2022 13:56:29 -0800 Subject: [PATCH] tcpmv2: pe: Add mux_set call following successful DATA_RESET MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL adds a call to set_usb_mux_with_current_data_role after performing a successful DATA_RESET. This is being added to satisfy 6.3.14 Data_Reset Message, item #3: If the Port was operating in [USB 3.2] or [USB4] reapply the port’s Rx Terminations (see [USB 3.2]). Without this call a mode entry attempt that is either not successful, or rejected by the port partner would leave the USB3.x SS lanes disconnected. This would also be the case following an Exit_Mode request from the AP when DATA_RESET is supported. BUG=b:260095516 BRANCH=none TEST=using drivers.usbc_usb4_mode integration test to verify that the mux ends up in the correct state following a DATA_RESET. Signed-off-by: Scott Collyer Change-Id: I3b6f9d00beb5fcc5a68c44887bde03d22b61d3e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4040832 Tested-by: Scott Collyer Commit-Queue: Scott Collyer Code-Coverage: Zoss Reviewed-by: Abe Levkoy --- common/usbc/usb_pe_drp_sm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index f2bc65da29..5219b9b418 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -7686,8 +7686,7 @@ static void pe_ddr_perform_data_reset_run(int port) * interpretations are mutually exclusive. Resolve that * ambiguity and update this implementation. */ - usb_mux_set(port, USB_PD_MUX_NONE, USB_SWITCH_DISCONNECT, - polarity_rm_dts(pd_get_polarity(port))); + set_usb_mux_with_current_data_role(port); } else if (IS_ENABLED(CONFIG_USBC_VCONN) && PE_CHK_FLAG(port, PE_FLAGS_VCONN_SWAP_COMPLETE) && tc_is_vconn_src(port)) {