summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2020-01-29 12:48:30 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-30 23:40:40 +0000
commit11adea9322bde6390a8364581d32096614c46d49 (patch)
treee1a84cb91bb3d603d08241548411ba7a50c9f57d
parentf6944a414d8e6d51b51a6a510ac6b6483225582e (diff)
downloadchrome-ec-11adea9322bde6390a8364581d32096614c46d49.tar.gz
USB PD: set last rx'd msg ID as invalid before executing soft reset
If the last message ID received was a 0, then executing "pd N soft" on the EC shell would incorrectly mark the next message received as a repeat message. This change resets the last received message ID to the invalid value before executing the soft reset. BUG=b:146811519 BRANCH=firmware-hatch-12672.B TEST=Executing "pd 0 swap power pd 0 soft" while connected as a SNK to a servo V4 no longer results in a loop because the message was not marked as a repeat any more. Change-Id: I754d1d3ed9f7a4a5163b0f3cd4bb844f47e0ccc7 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2028359 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> (cherry picked from commit 8acad8f93f1cd221d6f683c908a0c2f4115b2133) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2032153
-rw-r--r--common/usb_pd_protocol.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/usb_pd_protocol.c b/common/usb_pd_protocol.c
index 8fe7dbe011..53759810a9 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -4446,6 +4446,7 @@ void pd_task(void *u)
case PD_STATE_SOFT_RESET:
if (pd[port].last_state != pd[port].task_state) {
/* Message ID of soft reset is always 0 */
+ invalidate_last_message_id(port);
pd[port].msg_id = 0;
res = send_control(port, PD_CTRL_SOFT_RESET);