summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McRae <amcrae@google.com>2020-07-27 13:22:37 +1000
committerCommit Bot <commit-bot@chromium.org>2020-07-29 05:59:08 +0000
commita2c570baef5ebd735931a4cb0161400b76a4310e (patch)
tree563d3ebfe220201ec556b73ec21658faf1265cf3
parentce168ae28c77a8b936efd2566dbf566834ba2913 (diff)
downloadchrome-ec-a2c570baef5ebd735931a4cb0161400b76a4310e.tar.gz
TCPMv2: Send Soft Reset for unexpected message
Compliance TD.PD.SRC3.E24 failed because an unexpected message did not respond with a soft reset (unsupported or unknown messages were being handled correctly). Unexpected messages should be handled with a soft reset message. BUG=b:161836207 TEST=Check with type-C monitor BRANCH=none Change-Id: Ia9dda23dfa919a4cc23af0579119e37a011c0739 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2319492 Reviewed-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org>
-rw-r--r--common/usbc/usb_pe_drp_sm.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/common/usbc/usb_pe_drp_sm.c b/common/usbc/usb_pe_drp_sm.c
index 5a8cc632a8..ad955579d0 100644
--- a/common/usbc/usb_pe_drp_sm.c
+++ b/common/usbc/usb_pe_drp_sm.c
@@ -2068,6 +2068,21 @@ static void pe_src_ready_run(int port)
case PD_CTRL_VCONN_SWAP:
set_state_pe(port, PE_VCS_EVALUATE_SWAP);
return;
+ /*
+ * USB PD 3.0 6.8.1:
+ * Receiving an unexpected message shall be responded
+ * to with a soft reset message.
+ */
+ case PD_CTRL_ACCEPT:
+ case PD_CTRL_REJECT:
+ case PD_CTRL_WAIT:
+ case PD_CTRL_PS_RDY:
+ set_state_pe(port, PE_SEND_SOFT_RESET);
+ return;
+ /*
+ * Receiving an unknown or unsupported message
+ * shall be responded to with a not supported message.
+ */
default:
set_state_pe(port, PE_SEND_NOT_SUPPORTED);
return;
@@ -2799,6 +2814,21 @@ static void pe_snk_ready_run(int port)
case PD_CTRL_NOT_SUPPORTED:
/* Do nothing */
break;
+ /*
+ * USB PD 3.0 6.8.1:
+ * Receiving an unexpected message shall be responded
+ * to with a soft reset message.
+ */
+ case PD_CTRL_ACCEPT:
+ case PD_CTRL_REJECT:
+ case PD_CTRL_WAIT:
+ case PD_CTRL_PS_RDY:
+ set_state_pe(port, PE_SEND_SOFT_RESET);
+ return;
+ /*
+ * Receiving an unknown or unsupported message
+ * shall be responded to with a not supported message.
+ */
default:
set_state_pe(port, PE_SEND_NOT_SUPPORTED);
return;