Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b36b5f07 authored by Dilip Kota's avatar Dilip Kota Committed by Gerrit - the friendly Code Review server
Browse files

msm_serial_hs: Initialize tty_flush_recieve while Port Open



Initialize the tty_flush_recieve to default value during
Port Open to avoid a corner case where Tx bytes may get queued
twice by UART in the absence of initialization.

Corner Case:
UART client calls uart_flush_buffer() API to flush the
data on Tx while UART Tx is in middle of operation.
If client immediately calls UART Port close followed by UART Tx
after Port-Open, it may result in queueing same bytes twice

CRs-Fixed: 590459
Change-Id: Ied9d33265060e1fde7fc98e29f58d3eff6ddc3c4
Signed-off-by: default avatarDilip Kota <c_dkota@codeaurora.org>
parent 62bf7693
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2643,6 +2643,8 @@ static int msm_hs_startup(struct uart_port *uport)
	/* Initialize the tx */
	tx->tx_ready_int_en = 0;
	tx->dma_in_flight = 0;
	msm_uport->tty_flush_receive = false;
	MSM_HS_DBG("%s: Setting tty_flush_receive to false\n", __func__);

	if (!is_blsp_uart(msm_uport)) {
		tx->xfer.complete_func = msm_hs_dmov_tx_callback;