diff options
author | Scott Collyer <scollyer@google.com> | 2021-03-08 19:30:44 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-17 19:13:39 +0000 |
commit | 6f12cb4866278a10e08bd6dd5e8f8e77119f3063 (patch) | |
tree | e4e764512d319af59e7d6c2c7f3d0bc9ae81ce1d /common/usbc/usb_pe_drp_sm.c | |
parent | 6e4f5c6a44df835f3fec7282aad37ac611d3f64b (diff) | |
download | chrome-ec-6f12cb4866278a10e08bd6dd5e8f8e77119f3063.tar.gz |
TCPMv2: Don't reply to SVDMs in rev2.0 as a DFP
When are connected to a rev2.0 port partner and in a DFP data role,
the only SVDM command that is allowed is the Attention message. All
other SVDM commands should be NAK'd. This CL adds a change to the
svdm_response function in PE to check for this case.
This change fixes TD.PD.VDMD.E4 compliance test.
BUG=b:182495985
BRANCH=None
TEST=Verified that TD.PD.VDMD.E4 compliance test passes on quiche
Signed-off-by: Scott Collyer <scollyer@google.com>
Change-Id: I05bb639b81f634239b6db948ebb760c08b748c08
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2751330
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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c index 39d390dc86..4e9d1b2c44 100644 --- a/common/usbc/usb_pe_drp_sm.c +++ b/common/usbc/usb_pe_drp_sm.c @@ -5938,7 +5938,13 @@ static void pe_vdm_response_entry(int port) CPRINTF("VDO ERR:CMD:%d\n", vdo_cmd); } - if (func) { + /* + * If the port partner is PD_REV20 and our data role is DFP, we must + * reply to any SVDM command with a NAK. If the SVDM was an Attention + * command, it does not have a response, and exits the function above. + */ + if (func && (prl_get_rev(port, TCPC_TX_SOP) != PD_REV20 || + pe[port].data_role == PD_ROLE_UFP)) { /* * Execute SVDM response function selected above and set the * correct response type in the VDM header. |