Skip to contentSkip to conversation

Patch "ASoC: rcar: clear DE bit only in PDMACHCR when it stops" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Dec 18, 2017

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ASoC: rcar: clear DE bit only in PDMACHCR when it stops

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
asoc-rcar-clear-de-bit-only-in-pdmachcr-when-it-stops.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Dec 18 14:12:34 CET 2017

From: Kuninori Morimoto <[email protected]>
Date: Tue, 14 Mar 2017 09:34:49 +0900
Subject: ASoC: rcar: clear DE bit only in PDMACHCR when it stops

From: Kuninori Morimoto <[email protected]>

[ Upstream commit 62a10498afb27370ec6018e9d802b74850fd8d9a ]

R-Car datasheet indicates "Clear DE in PDMACHCR" for transfer stop, but current code clears all bits in PDMACHCR.
Because of this, DE bit might never been cleared,
and it causes CMD overflow. This patch fixes this issue.

---
 sound/soc/sh/rcar/dma.c |   18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/dma.c +16 -2
@@ -361,6 +361,20 @@ static u32 rsnd_dmapp_read(struct rsnd_d
 	return ioread32(rsnd_dmapp_addr(dmac, dma, reg));
 }
 
+static void rsnd_dmapp_bset(struct rsnd_dma *dma, u32 data, u32 mask, u32 reg)
+{
+	struct rsnd_mod *mod = rsnd_mod_get(dma);
+	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
+	struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
+	volatile void __iomem *addr = rsnd_dmapp_addr(dmac, dma, reg);
+	u32 val = ioread32(addr);
+
+	val &= ~mask;
+	val |= (data & mask);
+
+	iowrite32(val, addr);
+}
+
 static int rsnd_dmapp_stop(struct rsnd_mod *mod,
 			   struct rsnd_dai_stream *io,
 			   struct rsnd_priv *priv)
@@ -368,10 +382,10 @@ static int rsnd_dmapp_stop(struct rsnd_m
 	struct rsnd_dma *dma = rsnd_mod_to_dma(mod);
 	int i;
 
-	rsnd_dmapp_write(dma, 0, PDMACHCR);
+	rsnd_dmapp_bset(dma, 0,  PDMACHCR_DE, PDMACHCR);
 
 	for (i = 0; i < 1024; i++) {
-		if (0 == rsnd_dmapp_read(dma, PDMACHCR))
+		if (0 == (rsnd_dmapp_read(dma, PDMACHCR) & PDMACHCR_DE))
 			return 0;
 		udelay(1);
 	}

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/dmaengine-rcar-dmac-use-tcrb-instead-of-tcr-for-residue.patch queue-4.9/asoc-rcar-clear-de-bit-only-in-pdmachcr-when-it-stops.patch queue-4.9/asoc-rsnd-rsnd_ssi_run_mods-needs-to-care-ssi_parent_mod.patch queue-4.9/asoc-rsnd-fix-sound-route-path-when-using-src6-src9.patch