dma: pl330: Limit MFIFO usage for memcpy to avoid exhausting entries
authorJon Medhurst <tixy@linaro.org>
Tue, 15 Apr 2014 16:50:17 +0000 (17:50 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Fri, 31 Oct 2014 12:22:15 +0000 (12:22 +0000)
The MFIFO is shared by all channels so restrict each memcpy to it's fair
share. This is being over cautious, but without a global view of DMA
channel usage on a system it's not possible to come up with a more
optimum safe limit.

Signed-off-by: Jon Medhurst <tixy@linaro.org>
drivers/dma/pl330.c

index 56ad8e6..203a662 100644 (file)
@@ -2633,7 +2633,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len)
        int burst_len;
 
        burst_len = pi->pcfg.data_bus_width / 8;
-       burst_len *= pi->pcfg.data_buf_dep;
+       burst_len *= pi->pcfg.data_buf_dep / pi->pcfg.num_chan;
        burst_len >>= desc->rqcfg.brst_size;
 
        /* src/dst_burst_len can't be more than 16 */