1
0
Fork 0

MLK-19260-1: spi: spi-imx: fix tx dma timeout

Upstreaming code already support dynamically adjust watermark with
the transfer count, so in case 'wml=1', tx wml will be set to 0
after divided by 2, which cause tx dma never start.Actually, don't
need promise tx_wml=rx_wml/2 any more, because the max wml for tx/rx
is half of fifo size and sdma script have already check the data count
in RXFIFO, if more than half of rxfifo data remain in rxfifo, tx dma
will never start transfer next 'watermark'(the max count maybe the half
of fifo size) data until the data in rxfifo less than half of rxfifo.
So never any data loss happen. Remove 'wml/2'.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Han Xu <han.xu@nxp.com>
pull/10/head
Robin Gong 2018-08-18 00:51:33 +08:00 committed by Jason Liu
parent a95d74a594
commit 729e1ccec3
1 changed files with 2 additions and 2 deletions

View File

@ -536,7 +536,7 @@ static int mx51_ecspi_config(struct spi_device *spi)
* and enable DMA request.
*/
if (spi_imx->devtype_data->devtype == IMX6UL_ECSPI)
tx_wml = spi_imx->wml / 2;
tx_wml = spi_imx->wml;
if (spi_imx->usedma)
writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml) |
@ -1030,7 +1030,7 @@ static int spi_imx_dma_configure(struct spi_master *master)
tx.direction = DMA_MEM_TO_DEV;
tx.dst_addr = spi_imx->base_phys + MXC_CSPITXDATA;
tx.dst_addr_width = buswidth;
tx.dst_maxburst = spi_imx->wml / 2;
tx.dst_maxburst = spi_imx->wml;
ret = dmaengine_slave_config(master->dma_tx, &tx);
if (ret) {
dev_err(spi_imx->dev, "TX dma configuration failed with %d\n", ret);