Commit 804f0901 authored by Marek Szyprowski's avatar Marek Szyprowski Committed by Greg Kroah-Hartman
Browse files

serial: samsung: fix maxburst parameter for DMA transactions



commit aa2f80e7 upstream.

The best granularity of residue that DMA engine can report is in the BURST
units, so the serial driver must use MAXBURST = 1 and DMA_SLAVE_BUSWIDTH_1_BYTE
if it relies on exact number of bytes transferred by DMA engine.

Fixes: 62c37eed ("serial: samsung: add dma reqest/release functions")
Signed-off-by: default avatarMarek Szyprowski <m.szyprowski@samsung.com>
Acked-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db30b8eb
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -865,14 +865,11 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p)
	dma->rx_conf.direction		= DMA_DEV_TO_MEM;
	dma->rx_conf.direction		= DMA_DEV_TO_MEM;
	dma->rx_conf.src_addr_width	= DMA_SLAVE_BUSWIDTH_1_BYTE;
	dma->rx_conf.src_addr_width	= DMA_SLAVE_BUSWIDTH_1_BYTE;
	dma->rx_conf.src_addr		= p->port.mapbase + S3C2410_URXH;
	dma->rx_conf.src_addr		= p->port.mapbase + S3C2410_URXH;
	dma->rx_conf.src_maxburst	= 16;
	dma->rx_conf.src_maxburst	= 1;


	dma->tx_conf.direction		= DMA_MEM_TO_DEV;
	dma->tx_conf.direction		= DMA_MEM_TO_DEV;
	dma->tx_conf.dst_addr_width	= DMA_SLAVE_BUSWIDTH_1_BYTE;
	dma->tx_conf.dst_addr_width	= DMA_SLAVE_BUSWIDTH_1_BYTE;
	dma->tx_conf.dst_addr		= p->port.mapbase + S3C2410_UTXH;
	dma->tx_conf.dst_addr		= p->port.mapbase + S3C2410_UTXH;
	if (dma_get_cache_alignment() >= 16)
		dma->tx_conf.dst_maxburst = 16;
	else
	dma->tx_conf.dst_maxburst	= 1;
	dma->tx_conf.dst_maxburst	= 1;


	dma->rx_chan = dma_request_chan(p->port.dev, "rx");
	dma->rx_chan = dma_request_chan(p->port.dev, "rx");