[01/12] ASoC: rsnd: fixup rsnd_gen_dma_addr() for Gen1
diff mbox

Message ID 87bntqzjfw.wl%kuninori.morimoto.gx@renesas.com
State New, archived
Headers show

Commit Message

Kuninori Morimoto June 18, 2014, 8:54 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ad32d0c7b0e993433df152ae747652647eb65a27
(ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
added rsnd_gen_dma_addr() to calculate DMA addr,
but, it is necessary only for Gen2.
This patch ignores Gen1 case.
Kernel will be panic without this patch.
Special thanks to Simon

Reported-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/gen.c |   33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

Comments

Mark Brown June 18, 2014, 10:06 a.m. UTC | #1
On Wed, Jun 18, 2014 at 05:54:43PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> ad32d0c7b0e993433df152ae747652647eb65a27
> (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
> added rsnd_gen_dma_addr() to calculate DMA addr,

Applied, thanks.
Simon Horman July 28, 2014, 12:58 p.m. UTC | #2
On Wed, Jun 18, 2014 at 11:06:54AM +0100, Mark Brown wrote:
> On Wed, Jun 18, 2014 at 05:54:43PM +0900, Kuninori Morimoto wrote:
> > From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > 
> > ad32d0c7b0e993433df152ae747652647eb65a27
> > (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
> > added rsnd_gen_dma_addr() to calculate DMA addr,
> 
> Applied, thanks.

Hi,

I guess its a little too late in the cycle and I apologise
for not having noticed this earlier. It seems that while
this problem was added in v3.16-rc1 (by the patch detailed above)
the fix (this patch) is not present in v3.16-rc7.
Mark Brown July 28, 2014, 1:48 p.m. UTC | #3
On Mon, Jul 28, 2014 at 09:58:43PM +0900, Simon Horman wrote:
> On Wed, Jun 18, 2014 at 11:06:54AM +0100, Mark Brown wrote:

> > > ad32d0c7b0e993433df152ae747652647eb65a27
> > > (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
> > > added rsnd_gen_dma_addr() to calculate DMA addr,

> > Applied, thanks.

> I guess its a little too late in the cycle and I apologise
> for not having noticed this earlier. It seems that while
> this problem was added in v3.16-rc1 (by the patch detailed above)
> the fix (this patch) is not present in v3.16-rc7.

Yeah, I've got too big a backlog of fixes to actually send to Linus at
this point.
Simon Horman July 29, 2014, 12:52 a.m. UTC | #4
On Mon, Jul 28, 2014 at 02:48:04PM +0100, Mark Brown wrote:
> On Mon, Jul 28, 2014 at 09:58:43PM +0900, Simon Horman wrote:
> > On Wed, Jun 18, 2014 at 11:06:54AM +0100, Mark Brown wrote:
> 
> > > > ad32d0c7b0e993433df152ae747652647eb65a27
> > > > (ASoC: rsnd: add rsnd_gen_dma_addr() for DMAC addr)
> > > > added rsnd_gen_dma_addr() to calculate DMA addr,
> 
> > > Applied, thanks.
> 
> > I guess its a little too late in the cycle and I apologise
> > for not having noticed this earlier. It seems that while
> > this problem was added in v3.16-rc1 (by the patch detailed above)
> > the fix (this patch) is not present in v3.16-rc7.
> 
> Yeah, I've got too big a backlog of fixes to actually send to Linus at
> this point.

Thanks. So long as it isn't completely lost I'm happy :)

Patch
diff mbox

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 1dd2b7d..0280a11 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -184,7 +184,7 @@  static int rsnd_gen_regmap_init(struct rsnd_priv *priv,
 #define RDMA_CMD_O_N(addr, i)	(addr ##_reg - 0x004f8000 + (0x400 * i))
 #define RDMA_CMD_O_P(addr, i)	(addr ##_reg - 0x001f8000 + (0x400 * i))
 
-void rsnd_gen_dma_addr(struct rsnd_priv *priv,
+static void rsnd_gen2_dma_addr(struct rsnd_priv *priv,
 		       struct rsnd_dma *dma,
 		       struct dma_slave_config *cfg,
 		       int is_play, int slave_id)
@@ -226,17 +226,6 @@  void rsnd_gen_dma_addr(struct rsnd_priv *priv,
 		}
 	};
 
-	cfg->slave_id	= slave_id;
-	cfg->src_addr	= 0;
-	cfg->dst_addr	= 0;
-	cfg->direction	= is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
-
-	/*
-	 * gen1 uses default DMA addr
-	 */
-	if (rsnd_is_gen1(priv))
-		return;
-
 	/* it shouldn't happen */
 	if (use_dvc & !use_src) {
 		dev_err(dev, "DVC is selected without SRC\n");
@@ -250,6 +239,26 @@  void rsnd_gen_dma_addr(struct rsnd_priv *priv,
 		id, cfg->src_addr, cfg->dst_addr);
 }
 
+void rsnd_gen_dma_addr(struct rsnd_priv *priv,
+		       struct rsnd_dma *dma,
+		       struct dma_slave_config *cfg,
+		       int is_play, int slave_id)
+{
+	cfg->slave_id   = slave_id;
+	cfg->src_addr   = 0;
+	cfg->dst_addr   = 0;
+	cfg->direction  = is_play ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM;
+
+	/*
+	 * gen1 uses default DMA addr
+	 */
+	if (rsnd_is_gen1(priv))
+		return;
+
+	rsnd_gen2_dma_addr(priv, dma, cfg, is_play, slave_id);
+}
+
+
 /*
  *		Gen2
  */