diff options
author | Scott Collyer <scollyer@google.com> | 2021-03-08 19:30:44 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-19 17:40:10 +0000 |
commit | 67c4d4e09a33abbb28c686592617afaa485638a2 (patch) | |
tree | ab72cc5d6977a9c025a9d06366bb185f03f2b32e | |
parent | f5b3331acc0dab9c72cacd7c4e40df3342991595 (diff) | |
download | chrome-ec-67c4d4e09a33abbb28c686592617afaa485638a2.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>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774590
Tested-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
-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 e57acc173e..d5911168e3 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. |