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 22:29:29 +0000
commit8acad8f93f1cd221d6f683c908a0c2f4115b2133 (patch)
tree5a9424cc0586884d3fd6f8987c87b4ae20041eb8
parent04df9fbbf4953f0f3afbfca8f8cb656bb41146b4 (diff)
downloadchrome-ec-8acad8f93f1cd221d6f683c908a0c2f4115b2133.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>
-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 1a4093d32a..a73175a725 100644
--- a/common/usb_pd_protocol.c
+++ b/common/usb_pd_protocol.c
@@ -4472,6 +4472,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);