 +	memcpy(dma->tx_buf, xmit->buf + xmit->tail, chunk1);
 +	
 +	chunk2 = CIRC_CNT(head, xmit->tail, UART_XMIT_SIZE) - chunk1;
-+	if(chunk2 > 0) {
++	if (chunk2 > 0) {
 +		memcpy(dma->tx_buf + chunk1, xmit->buf, chunk2);
 +	}
 +	dma->tx_size = chunk1 + chunk2;

 	dma->txchan = NULL;
 	dma->tx_running = 0;
-- 
2.17.1


8250_dma used the circular xmit->buf as DMA output buffer. This causes messages that wrap around
in the circular buffer to be transmitted using 2 DMA transfers. Depending on baud rate and processor
load this can cause an interchar gap in the middle of the message. On the receiving end the gap
may cause a short receive timeout, possibly long enough to terminate a DMA transfer, but too short
to restart a receive DMA transfer in time thus causing a receive buffer overrun.
Fix this but creating a linear tx_buffer and copying all of xmit->buf into it.

Signed-off-by: Ferry Toth <ftoth@exalondelft.nl>
---
 drivers/tty/serial/8250/8250.h     |  1 +
 drivers/tty/serial/8250/8250_dma.c | 33 ++++++++++++++++++++++++------
 2 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h
index 52bb21205bb6..5ab8b05e87ac 100644
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -41,6 +41,7 @@ struct uart_8250_dma {
 	dma_cookie_t		tx_cookie;
 
 	void			*rx_buf;
