From 0bed4ff51b31d17dbea678425578cb92260f0127 Mon Sep 17 00:00:00 2001 From: Sam Hurst Date: Wed, 11 Sep 2019 10:28:47 -0700 Subject: pd: Fix Incorrect Message Header Rev number sent to port partner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When constructing a message, the current SOP* is used instead of the last SOP*. And last SOP* is cleared on port detach. BUG=b:140865004 BRANCH=none TEST=manual   Used Total Phase analyzer to verify that correct Message Header   Revisions. Change-Id: I7f09746a36c9bcd4380ab6c6544f04b7079189ed Signed-off-by: Sam Hurst Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1797371 Tested-by: Sam Hurst Reviewed-by: Denis Brockus Commit-Queue: Sam Hurst --- common/usbc/usb_prl_sm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/usbc/usb_prl_sm.c b/common/usbc/usb_prl_sm.c index 0321c0c1b0..9342f0dcc8 100644 --- a/common/usbc/usb_prl_sm.c +++ b/common/usbc/usb_prl_sm.c @@ -294,6 +294,7 @@ static void prl_init(int port) const struct sm_ctx cleared = {}; prl_tx[port].flags = 0; + prl_tx[port].sop = 0; prl_tx[port].xmit_status = TCPC_TX_UNSET; tch[port].flags = 0; @@ -609,7 +610,7 @@ static void prl_tx_construct_message(int port) tc_get_data_role(port), prl_tx[port].msg_id_counter[pdmsg[port].xmit_type], pdmsg[port].data_objs, - (prl_tx[port].sop == TCPC_TX_SOP) ? + (pdmsg[port].xmit_type == TCPC_TX_SOP) ? pdmsg[port].rev : pdmsg[port].cable_rev, pdmsg[port].ext); -- cgit v1.2.1