All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Pundir <amit.pundir@linaro.org>
To: stable@vger.kernel.org
Cc: gregkh@linuxfoundation.org, Matthias Reichl <hias@horus.com>,
	Martin Sperl <kernel@martin.sperl.org>,
	Vinod Koul <vinod.koul@intel.com>
Subject: [PATCH v2 for-4.9 15/32] dmaengine: bcm2835: Fix cyclic DMA period splitting
Date: Wed,  5 Apr 2017 16:02:07 +0530	[thread overview]
Message-ID: <1491388344-13521-16-git-send-email-amit.pundir@linaro.org> (raw)
In-Reply-To: <1491388344-13521-1-git-send-email-amit.pundir@linaro.org>

From: Matthias Reichl <hias@horus.com>

The code responsible for splitting periods into chunks that
can be handled by the DMA controller missed to update total_len,
the number of bytes processed in the current period, when there
are more chunks to follow.

Therefore total_len was stuck at 0 and the code didn't work at all.
This resulted in a wrong control block layout and audio issues because
the cyclic DMA callback wasn't executing on period boundaries.

Fix this by adding the missing total_len update.

Signed-off-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Tested-by: Clive Messer <clive.messer@digitaldreamtime.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
(cherry picked from commit 2201ac6129fa162ac24da089a034bb0971648ebb)
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
 drivers/dma/bcm2835-dma.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index e18dc59..6204cc3 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -251,8 +251,11 @@ static void bcm2835_dma_create_cb_set_length(
 	 */
 
 	/* have we filled in period_length yet? */
-	if (*total_len + control_block->length < period_len)
+	if (*total_len + control_block->length < period_len) {
+		/* update number of bytes in this period so far */
+		*total_len += control_block->length;
 		return;
+	}
 
 	/* calculate the length that remains to reach period_length */
 	control_block->length = period_len - *total_len;
-- 
2.7.4

  parent reply	other threads:[~2017-04-05 10:33 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 10:31 [PATCH v2 for-4.9 00/32] Stable commits picked up from lede project Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 01/32] ARM: BCM5301X: Add back handler ignoring external imprecise aborts Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 02/32] ARM: dts: BCM5301X: Correct GIC_PPI interrupt flags Amit Pundir
2017-04-06  7:33   ` Greg KH
2017-04-05 10:31 ` [PATCH v2 for-4.9 03/32] PCI: iproc: Save host bridge window resource in struct iproc_pcie Amit Pundir
2017-04-06  7:33   ` Greg KH
2017-04-05 10:31 ` [PATCH v2 for-4.9 04/32] MIPS: Lantiq: Fix cascaded IRQ setup Amit Pundir
2017-04-06  7:34   ` Greg KH
2017-04-06  9:29   ` James Hogan
2017-04-06  9:29     ` James Hogan
2017-04-06 10:53     ` Amit Pundir
2017-04-06 11:25       ` James Hogan
2017-04-06 11:25         ` James Hogan
2017-04-06 11:44         ` Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 05/32] i2c: bcm2835: Fix hang for writing messages larger than 16 bytes Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 06/32] i2c: bcm2835: Protect against unexpected TXW/RXR interrupts Amit Pundir
2017-04-05 10:31 ` [PATCH v2 for-4.9 07/32] i2c: bcm2835: Use dev_dbg logging on transfer errors Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 08/32] i2c: bcm2835: Can't support I2C_M_IGNORE_NAK Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 09/32] clk: bcm: Support rate change propagation on bcm2835 clocks Amit Pundir
2017-04-12 13:17   ` Greg KH
2017-04-12 13:33     ` Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 10/32] clk: bcm: Allow rate change propagation to PLLH_AUX on VEC clock Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 11/32] clk: bcm: Fix 'maybe-uninitialized' warning in bcm2835_clock_choose_div_and_prate() Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 12/32] clk: bcm2835: Don't rate change PLLs on behalf of DSI PLL dividers Amit Pundir
2017-04-06 16:53   ` Eric Anholt
2017-04-05 10:32 ` [PATCH v2 for-4.9 13/32] clk: bcm2835: Register the DSI0/DSI1 pixel clocks Amit Pundir
2017-04-12 13:15   ` Greg KH
2017-04-05 10:32 ` [PATCH v2 for-4.9 14/32] clk: bcm2835: Add leaf clock measurement support, disabled by default Amit Pundir
2017-04-05 10:32 ` Amit Pundir [this message]
2017-04-05 10:32 ` [PATCH v2 for-4.9 16/32] usb: dwc2: Remove unnecessary kfree Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 17/32] mtd: bcm47xxpart: fix parsing first block after aligned TRX Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 18/32] net: add devm version of alloc_etherdev_mqs function Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 19/32] net: bgmac: allocate struct bgmac just once & don't copy it Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 20/32] net: bgmac: drop struct bcma_mdio we don't need anymore Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 21/32] of: Add check to of_scan_flat_dt() before accessing initial_boot_params Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 22/32] rt2500usb: don't mark register accesses as inline Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 23/32] brcmfmac: check brcmf_bus_get_memdump result for error Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 24/32] brcmfmac: be more verbose when PSM's watchdog fires Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 25/32] brcmfmac: merge two brcmf_err macros into one Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 26/32] brcmfmac: switch to C function (__brcmf_err) for printing errors Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 27/32] brcmfmac: merge two remaining brcmf_err macros Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 28/32] rt2x00usb: do not anchor rx and tx urb's Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 29/32] rt2x00usb: fix anchor initialization Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 30/32] brcmfmac: Use net_device_stats from struct net_device Amit Pundir
2017-04-12 13:18   ` Greg KH
2017-04-12 13:46     ` Tobias Klauser
2017-04-12 13:52     ` Kalle Valo
2017-04-12 14:29       ` Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 31/32] rt2x00: Fix incorrect usage of CONFIG_RT2X00_LIB_USB Amit Pundir
2017-04-05 10:32 ` [PATCH v2 for-4.9 32/32] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Amit Pundir
2017-04-06  7:29 ` [PATCH v2 for-4.9 00/32] Stable commits picked up from lede project Greg KH
2017-04-06  7:44   ` Amit Pundir

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1491388344-13521-16-git-send-email-amit.pundir@linaro.org \
    --to=amit.pundir@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hias@horus.com \
    --cc=kernel@martin.sperl.org \
    --cc=stable@vger.kernel.org \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.