summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Nematbakhsh <shawnn@chromium.org>2015-11-30 12:52:49 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-12-01 01:11:07 -0800
commit326bff520bc44271ee1a09e8756c615768912efa (patch)
tree4f3179c7441051943b9b1823b7441ac75262c680
parent9ea7ca8d87a5d6d9a8ff8e95230d7f38ee2f1eda (diff)
downloadchrome-ec-326bff520bc44271ee1a09e8756c615768912efa.tar.gz
fusb302: Don't flush RX FIFO on GoodCRC
Depending on timing, additional important messages may reside on our RX FIFO at the time we process GoodCRC. Therefore, rather than flushing the RX FIFO, simply read and discard the GoodCRC message. BUG=chrome-os-partner:314492 BRANCH=None TEST=Manual on Snoball with subsequent PWM changes. Verify PD contact can be established with samus. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I4f4fab1bc318d1bce1effffad9a792c5b4a43761 Reviewed-on: https://chromium-review.googlesource.com/314871 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--driver/tcpm/fusb302.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/driver/tcpm/fusb302.c b/driver/tcpm/fusb302.c
index a14cd92eb4..294df7e4dd 100644
--- a/driver/tcpm/fusb302.c
+++ b/driver/tcpm/fusb302.c
@@ -797,6 +797,8 @@ void tcpc_alert(int port)
int interruptb;
int reg;
int toggle_answer;
+ int head;
+ uint32_t payload[7];
/* reading interrupt registers clears them */
@@ -816,10 +818,11 @@ void tcpc_alert(int port)
}
if (interrupta & TCPC_REG_INTERRUPTA_TX_SUCCESS) {
- /* sent packet was acknowledged with a GoodCRC */
-
- /* flush out the GoodCRC message*/
- fusb302_flush_rx_fifo(port);
+ /*
+ * Sent packet was acknowledged with a GoodCRC,
+ * so remove GoodCRC message from FIFO.
+ */
+ tcpm_get_message(port, payload, &head);
pd_transmit_complete(port, TCPC_TX_COMPLETE_SUCCESS);
}