Skip to contentSkip to conversation

Patch "tty: serial: msm: Don't read off end of tx fifo" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Aug 18, 2016

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

tty: serial: msm: Don't read off end of tx fifo

to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
tty-serial-msm-don-t-read-off-end-of-tx-fifo.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 30acf549ca1e81859a67590ab9ecfce3d1050a0b Mon Sep 17 00:00:00 2001

From: Bjorn Andersson <[email protected]>
Date: Thu, 2 Jun 2016 17:48:28 -0700
Subject: tty: serial: msm: Don't read off end of tx fifo

From: Bjorn Andersson <[email protected]>

commit 30acf549ca1e81859a67590ab9ecfce3d1050a0b upstream.

For dm uarts in pio mode tx data is transferred to the fifo register 4 bytes at a time, but care is not taken when these 4 bytes spans the end of the xmit buffer so the loop might read up to 3 bytes past the buffer and then skip the actual data at the beginning of the buffer.

Fix this by, analogous to the DMA case, make sure the chunk doesn't wrap the xmit buffer.

---
 drivers/tty/serial/msm_serial.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/msm_serial.c +1 -1
@@ -726,7 +726,7 @@ static void msm_handle_tx(struct uart_po
 		return;
 	}
 
-	pio_count = CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE);
+	pio_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
 	dma_count = CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE);
 
 	dma_min = 1;	/* Always DMA */

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/mfd-qcom_rpm-parametrize-also-ack-selector-size.patch queue-4.7/tty-serial-msm-don-t-read-off-end-of-tx-fifo.patch queue-4.7/mfd-qcom_rpm-fix-offset-error-for-msm8660.patch