Patchwork [1/1,v2] i.MX SDMA: Fix burstsize settings

login
register
mail settings
Submitter Philippe Rétornaz
Date Jan. 24, 2012, 1:22 p.m.
Message ID <1327411321-30017-1-git-send-email-philippe.retornaz@epfl.ch>
Download mbox | patch
Permalink /patch/137556/
State New
Headers show

Comments

Philippe Rétornaz - Jan. 24, 2012, 1:22 p.m.
Commit 6584cb88 (ARM i.MX dma: Fix burstsize settings) fixed
the mxcmmc driver but forgot to fix the SDMA driver to handle the
correct burtsize.
This make the SD card access works again with DMA on i.MX31 boards.

Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/dma/imx-sdma.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Koul, Vinod - Feb. 2, 2012, 8:34 a.m.
On Tue, 2012-01-24 at 14:22 +0100, Philippe Rétornaz wrote:
> Commit 6584cb88 (ARM i.MX dma: Fix burstsize settings) fixed
> the mxcmmc driver but forgot to fix the SDMA driver to handle the
> correct burtsize.
> This make the SD card access works again with DMA on i.MX31 boards.
> 
> Signed-off-by: Philippe Rétornaz <philippe.retornaz@epfl.ch>
> Tested-by: Sascha Hauer <s.hauer@pengutronix.de>
> Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Applied thanks
> ---
>  drivers/dma/imx-sdma.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
> index f993955..c193dac 100644
> --- a/drivers/dma/imx-sdma.c
> +++ b/drivers/dma/imx-sdma.c
> @@ -1095,11 +1095,13 @@ static int sdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  	case DMA_SLAVE_CONFIG:
>  		if (dmaengine_cfg->direction == DMA_FROM_DEVICE) {
>  			sdmac->per_address = dmaengine_cfg->src_addr;
> -			sdmac->watermark_level = dmaengine_cfg->src_maxburst;
> +			sdmac->watermark_level = dmaengine_cfg->src_maxburst *
> +						dmaengine_cfg->src_addr_width;
>  			sdmac->word_size = dmaengine_cfg->src_addr_width;
>  		} else {
>  			sdmac->per_address = dmaengine_cfg->dst_addr;
> -			sdmac->watermark_level = dmaengine_cfg->dst_maxburst;
> +			sdmac->watermark_level = dmaengine_cfg->dst_maxburst *
> +						dmaengine_cfg->dst_addr_width;
>  			sdmac->word_size = dmaengine_cfg->dst_addr_width;
>  		}
>  		return sdma_config_channel(sdmac);

Patch

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index f993955..c193dac 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1095,11 +1095,13 @@  static int sdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	case DMA_SLAVE_CONFIG:
 		if (dmaengine_cfg->direction == DMA_FROM_DEVICE) {
 			sdmac->per_address = dmaengine_cfg->src_addr;
-			sdmac->watermark_level = dmaengine_cfg->src_maxburst;
+			sdmac->watermark_level = dmaengine_cfg->src_maxburst *
+						dmaengine_cfg->src_addr_width;
 			sdmac->word_size = dmaengine_cfg->src_addr_width;
 		} else {
 			sdmac->per_address = dmaengine_cfg->dst_addr;
-			sdmac->watermark_level = dmaengine_cfg->dst_maxburst;
+			sdmac->watermark_level = dmaengine_cfg->dst_maxburst *
+						dmaengine_cfg->dst_addr_width;
 			sdmac->word_size = dmaengine_cfg->dst_addr_width;
 		}
 		return sdma_config_channel(sdmac);