brcm2708: update linux 4.4 patches to latest version
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.4 / 0404-dmaengine-bcm2835-Fix-cyclic-DMA-period-splitting.patch
1 From 9c9db58d0b33e3fd7e67a3fc9910184e6f4d2f95 Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Tue, 7 Jun 2016 19:37:10 +0200
4 Subject: [PATCH] dmaengine: bcm2835: Fix cyclic DMA period splitting
5
6 The code responsible for splitting periods into chunks that
7 can be handled by the DMA controller missed to update total_len,
8 the number of bytes processed in the current period, when there
9 are more chunks to follow.
10
11 Therefore total_len was stuck at 0 and the code didn't work at all.
12 This resulted in a wrong control block layout and audio issues because
13 the cyclic DMA callback wasn't executing on period boundaries.
14
15 Fix this by adding the missing total_len update.
16
17 Signed-off-by: Matthias Reichl <hias@horus.com>
18 Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
19 Tested-by: Clive Messer <clive.messer@digitaldreamtime.co.uk>
20 ---
21 drivers/dma/bcm2835-dma.c | 5 ++++-
22 1 file changed, 4 insertions(+), 1 deletion(-)
23
24 --- a/drivers/dma/bcm2835-dma.c
25 +++ b/drivers/dma/bcm2835-dma.c
26 @@ -252,8 +252,11 @@ static void bcm2835_dma_create_cb_set_le
27 */
28
29 /* have we filled in period_length yet? */
30 - if (*total_len + control_block->length < period_len)
31 + if (*total_len + control_block->length < period_len) {
32 + /* update number of bytes in this period so far */
33 + *total_len += control_block->length;
34 return;
35 + }
36
37 /* calculate the length that remains to reach period_length */
38 control_block->length = period_len - *total_len;