diff options
author | Keith Short <keithshort@chromium.org> | 2021-05-13 16:27:39 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-03 18:53:43 +0000 |
commit | 060d6f85c02278660358116a75a0f991cc47b12b (patch) | |
tree | 4ac9bffcbca1bef6d058ad98400ac0faca6285f4 /common/usb_common.c | |
parent | 00ab08d7746028008bbc261777a1ae818cf9668e (diff) | |
download | chrome-ec-060d6f85c02278660358116a75a0f991cc47b12b.tar.gz |
tcpmv2: Don't enable USB mode until PD state resolved
Don't enable USB superspeed signals until the PD capability is known.
This fixes an issue where platforms that enable the virtual USB mux
violate the tSenderResponse timeout when the attached SRC sends the
Source Capabilities message.
BUG=b:187796705
BRANCH=none
TEST=Volteer - connect PD charger, obsserve no hard reset
TEST=Connect non-PD USB device, verify USB mode is enabled
TEST=Connect USB+DP monitor, verify DP mode entry and USB mode enabled
TEST=Connect USB4 dock, verify USB4 entry
TEST=faft_pd test suite passes on Voxel
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I4be08874178d1e225cf41939b9626a81b0da0524
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2895424
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Tested-by: caveh jalali <caveh@chromium.org>
Diffstat (limited to 'common/usb_common.c')
-rw-r--r-- | common/usb_common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/usb_common.c b/common/usb_common.c index 4f9e17fa4f..dc8fb21e0a 100644 --- a/common/usb_common.c +++ b/common/usb_common.c @@ -481,10 +481,17 @@ mux_state_t get_mux_mode_to_set(int port) /* * If the power role is sink and the PD partner device is not capable * of USB communication then disconnect. + * + * On an entry into Unattached.SNK, the partner may be PD capable but + * hasn't yet sent source capabilities. In this case, hold off enabling + * USB3 termination until the PD capability is resolved. + * + * TODO(b/188588458): TCPMv2: Delay enabling USB3 termination when USB4 + * is supported. */ if (IS_ENABLED(CONFIG_USB_PD_DUAL_ROLE) && pd_get_power_role(port) == PD_ROLE_SINK && - pd_capable(port) && + (pd_capable(port) || pd_waiting_on_partner_src_caps(port)) && !pd_get_partner_usb_comm_capable(port)) return USB_PD_MUX_NONE; |