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

Commit f549b9e1 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

serial: msm_geni_serial: memset RX buffer to Zero



Currently driver allocating RX buffer once in port open and use the
same buffer for each RX transfer. This buffer is not cleared in driver.
In some scenarios when SW got DMA_DONE interrupt and the RX buffer we are
still seeing the previously completed RX data in DDR buffer. DMA_DONE from
HW doesn't confirm that the DATA is copied to DDR, sometimes we are queuing
the stale data from previous transfer to tty flip_buffer.

This change is to memset RX buffer to zero after tty_flip_buffer_push
so that memset change will easily help us to identify suck scenarios.

Change-Id: If14bdf0377cd6764280f515b1b8e67f5629e32ce
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent aa3ac4aa
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1743,6 +1743,14 @@ static int msm_geni_serial_handle_dma_rx(struct uart_port *uport, bool drop_rx)
	tty_flip_buffer_push(tport);
	dump_ipc(msm_port->ipc_log_rx, "DMA Rx", (char *)msm_port->rx_buf, 0,
								rx_bytes);

	/*
	 * DMA_DONE interrupt doesn't confirm that the DATA is copied to
	 * DDR memory, sometimes we are queuing the stale data from previous
	 * transfer to tty flip_buffer, adding memset to zero
	 * change to idenetify such scenario.
	 */
	memset(msm_port->rx_buf, 0, rx_bytes);
exit_handle_dma_rx:

	return ret;