From: Anatolij Gustschin Date: Mon, 22 Nov 2010 17:35:18 +0000 (+0100) Subject: dmaengine: imx-sdma: fix bug in buffer descriptor initialization X-Git-Tag: upstream/snapshot3+hdmi~11690^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d2f5c276ea4b7b7e1b953926bac9d0b148fcce4e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git dmaengine: imx-sdma: fix bug in buffer descriptor initialization Currently while submitting scatterlists with more than one SG entry the DMA buffer address from the first SG entry is inserted into all initialized DMA buffer descriptors. This is due to the typo in the for_each_sg() loop where the scatterlist pointer is used for obtaining the DMA buffer address and _not_ the SG list iterator. As a result all received data will be written only into the first DMA buffer while reading. While writing the data from the first DMA buffer is send to the device multiple times. This caused the filesystem destruction on the MMC card when using DMA in mxcmmc driver. Signed-off-by: Anatolij Gustschin Acked-by: Sascha Hauer Signed-off-by: Dan Williams --- diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 0834323..13d6447 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -951,7 +951,7 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( struct sdma_buffer_descriptor *bd = &sdmac->bd[i]; int param; - bd->buffer_addr = sgl->dma_address; + bd->buffer_addr = sg->dma_address; count = sg->length;