From: Per Forlin <per.forlin@stericsson.com>
Date: Thu, 13 Oct 2011 10:11:36 +0000 (+0200)
Subject: dmaengine: ste_dma40: limit burst size to 16
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=92bb6cdb5302a4b0b3c6b6cfc0854aaed882c4bc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git

dmaengine: ste_dma40: limit burst size to 16

The client is not aware of the maximum burst size in the dma driver.  If
the size exceeds 16 set max to 16.

Signed-off-by: Per Forlin <per.forlin@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Fabio Baltieri <fabio.baltieri@linaro.org>
---

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index f5724d95ed48..2d0c63dcd84c 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -2578,6 +2578,14 @@ static int d40_set_runtime_config(struct dma_chan *chan,
 		return -EINVAL;
 	}
 
+	if (src_maxburst > 16) {
+		src_maxburst = 16;
+		dst_maxburst = src_maxburst * src_addr_width / dst_addr_width;
+	} else if (dst_maxburst > 16) {
+		dst_maxburst = 16;
+		src_maxburst = dst_maxburst * dst_addr_width / src_addr_width;
+	}
+
 	ret = dma40_config_to_halfchannel(d40c, &cfg->src_info,
 					  src_addr_width,
 					  src_maxburst);