All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20
@ 2018-09-06  3:20 Kuninori Morimoto
  2018-09-06  3:21 ` [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space Kuninori Morimoto
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Kuninori Morimoto @ 2018-09-06  3:20 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


Hi Mark

These are bug fix patches for Renesas Sound driver.

1)      : for mark/for-4.20
2) - 4) : for linus/master

Kuninori Morimoto (4):
  1) ASoC: rsnd: gen: use tab instead of white-space
  2) ASoC: rsnd: adg: care clock-frequency size
  3) ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER
  4) ASoC: rsnd: don't use %p for dev_dbg()

 sound/soc/sh/rcar/adg.c  |  9 +++++++--
 sound/soc/sh/rcar/core.c | 10 +++++++++-
 sound/soc/sh/rcar/dma.c  |  6 +++++-
 sound/soc/sh/rcar/gen.c  | 48 ++++++++++++++++++++++++------------------------
 4 files changed, 45 insertions(+), 28 deletions(-)

-- 
2.7.4



Best regards
---
Kuninori Morimoto

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space
  2018-09-06  3:20 [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20 Kuninori Morimoto
@ 2018-09-06  3:21 ` Kuninori Morimoto
  2018-09-06 10:44   ` Applied "ASoC: rsnd: gen: use tab instead of white-space" to the asoc tree Mark Brown
  2018-09-06  3:21 ` [PATCH 2/4] ASoC: rsnd: adg: care clock-frequency size Kuninori Morimoto
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-09-06  3:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

commit 8c9d75033340 ("ASoC: rsnd: ssiu: Support BUSIF
other than BUSIF0") added new SSIU registers.
But it is using white-space for it.
This patch fixup it to use tab.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/gen.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 3032869..1f7881cc 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -222,30 +222,30 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)
 		RSND_GEN_M_REG(SSI_BUSIF0_MODE,		0x0,	0x80),
 		RSND_GEN_M_REG(SSI_BUSIF0_ADINR,	0x4,	0x80),
 		RSND_GEN_M_REG(SSI_BUSIF0_DALIGN,	0x8,	0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_MODE,         0x20,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_ADINR,        0x24,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_DALIGN,       0x28,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_MODE,         0x40,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_ADINR,        0x44,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_DALIGN,       0x48,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_MODE,         0x60,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_ADINR,        0x64,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_DALIGN,       0x68,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_MODE,         0x500,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_ADINR,        0x504,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_DALIGN,       0x508,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_MODE,         0x520,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_ADINR,        0x524,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_DALIGN,       0x528,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_MODE,         0x540,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_ADINR,        0x544,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_DALIGN,       0x548,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_MODE,         0x560,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_ADINR,        0x564,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_DALIGN,       0x568,  0x80),
-		RSND_GEN_M_REG(SSI_MODE,	0xc,	0x80),
-		RSND_GEN_M_REG(SSI_CTRL,	0x10,	0x80),
-		RSND_GEN_M_REG(SSI_INT_ENABLE,	0x18,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_MODE,		0x20,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_ADINR,	0x24,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_DALIGN,	0x28,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_MODE,		0x40,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_ADINR,	0x44,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_DALIGN,	0x48,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_MODE,		0x60,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_ADINR,	0x64,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_DALIGN,	0x68,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_MODE,		0x500,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_ADINR,	0x504,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_DALIGN,	0x508,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_MODE,		0x520,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_ADINR,	0x524,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_DALIGN,	0x528,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_MODE,		0x540,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_ADINR,	0x544,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_DALIGN,	0x548,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_MODE,		0x560,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_ADINR,	0x564,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_DALIGN,	0x568,	0x80),
+		RSND_GEN_M_REG(SSI_MODE,		0xc,	0x80),
+		RSND_GEN_M_REG(SSI_CTRL,		0x10,	0x80),
+		RSND_GEN_M_REG(SSI_INT_ENABLE,		0x18,	0x80),
 	};
 
 	static const struct rsnd_regmap_field_conf conf_scu[] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/4] ASoC: rsnd: adg: care clock-frequency size
  2018-09-06  3:20 [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20 Kuninori Morimoto
  2018-09-06  3:21 ` [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space Kuninori Morimoto
@ 2018-09-06  3:21 ` Kuninori Morimoto
  2018-09-06 10:44   ` Applied "ASoC: rsnd: adg: care clock-frequency size" to the asoc tree Mark Brown
  2018-09-06  3:21 ` [PATCH 3/4] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Kuninori Morimoto
  2018-09-06  3:22 ` [PATCH 4/4] ASoC: rsnd: don't use %p for dev_dbg() Kuninori Morimoto
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-09-06  3:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ADG has buffer over flow bug if DT has more than 3 clock-frequency.
This patch fixup this issue, and uses first 2 values.

	clock-frequency = <x y>;	/* this is OK */
	clock-frequency = <x y z>;	/* this is NG */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
---
 sound/soc/sh/rcar/adg.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 3a3064d..051f964 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -462,6 +462,11 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
 		goto rsnd_adg_get_clkout_end;
 
 	req_size = prop->length / sizeof(u32);
+	if (req_size > REQ_SIZE) {
+		dev_err(dev,
+			"too many clock-frequency, use top %d\n", REQ_SIZE);
+		req_size = REQ_SIZE;
+	}
 
 	of_property_read_u32_array(np, "clock-frequency", req_rate, req_size);
 	req_48kHz_rate = 0;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/4] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER
  2018-09-06  3:20 [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20 Kuninori Morimoto
  2018-09-06  3:21 ` [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space Kuninori Morimoto
  2018-09-06  3:21 ` [PATCH 2/4] ASoC: rsnd: adg: care clock-frequency size Kuninori Morimoto
@ 2018-09-06  3:21 ` Kuninori Morimoto
  2018-09-06 10:44   ` Applied "ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER" to the asoc tree Mark Brown
  2018-09-06  3:22 ` [PATCH 4/4] ASoC: rsnd: don't use %p for dev_dbg() Kuninori Morimoto
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-09-06  3:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current rsnd driver will fallback to PIO mode if it can't get DMA
handler. But, DMA might return -EPROBE_DEFER when probe timing.
This driver always fallback to PIO mode especially from
commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because
of this reason.

The DMA driver will be probed later, but sound driver might be
probed as PIO mode in such case. This patch fixup this issue.
Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error
message in such case.
And it needs to call rsnd_adg_remove() individually if probe failed,
because it registers clk which should be unregister.

Maybe PIO fallback feature itself is not needed,
but let's keep it so far.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/sh/rcar/core.c | 10 +++++++++-
 sound/soc/sh/rcar/dma.c  |  4 ++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index e46415c..40d7dc4 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -482,7 +482,7 @@ static int rsnd_status_update(u32 *status,
 			(func_call && (mod)->ops->fn) ? #fn : "");	\
 		if (func_call && (mod)->ops->fn)			\
 			tmp = (mod)->ops->fn(mod, io, param);		\
-		if (tmp)						\
+		if (tmp && (tmp != -EPROBE_DEFER))			\
 			dev_err(dev, "%s[%d] : %s error %d\n",		\
 				rsnd_mod_name(mod), rsnd_mod_id(mod),	\
 						     #fn, tmp);		\
@@ -1557,6 +1557,14 @@ static int rsnd_probe(struct platform_device *pdev)
 		rsnd_dai_call(remove, &rdai->capture, priv);
 	}
 
+	/*
+	 * adg is very special mod which can't use rsnd_dai_call(remove),
+	 * and it registers ADG clock on probe.
+	 * It should be unregister if probe failed.
+	 * Mainly it is assuming -EPROBE_DEFER case
+	 */
+	rsnd_adg_remove(priv);
+
 	return ret;
 }
 
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index f99c1ab..b5f3bf8 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
 	/* try to get DMAEngine channel */
 	chan = rsnd_dmaen_request_channel(io, mod_from, mod_to);
 	if (IS_ERR_OR_NULL(chan)) {
+		/* Let's follow when -EPROBE_DEFER case */
+		if (PTR_ERR(chan) == -EPROBE_DEFER)
+			return PTR_ERR(chan);
+
 		/*
 		 * DMA failed. try to PIO mode
 		 * see
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/4] ASoC: rsnd: don't use %p for dev_dbg()
  2018-09-06  3:20 [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20 Kuninori Morimoto
                   ` (2 preceding siblings ...)
  2018-09-06  3:21 ` [PATCH 3/4] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Kuninori Morimoto
@ 2018-09-06  3:22 ` Kuninori Morimoto
  2018-09-06 10:44   ` Applied "ASoC: rsnd: don't use %p for dev_dbg()" to the asoc tree Mark Brown
  3 siblings, 1 reply; 9+ messages in thread
From: Kuninori Morimoto @ 2018-09-06  3:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

rsnd driver sometimes want to know which address is used when debugging.
But it will indicate "(____ptrval____)" if it used "%p" on dev_dbg().
Let's use "%pa" or "%px" for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
---
 sound/soc/sh/rcar/adg.c | 4 ++--
 sound/soc/sh/rcar/dma.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 051f964..28327dd 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -582,7 +582,7 @@ static void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct rsnd_adg *adg)
 	int i;
 
 	for_each_rsnd_clk(clk, adg, i)
-		dev_dbg(dev, "%s    : %p : %ld\n",
+		dev_dbg(dev, "%s    : %pa : %ld\n",
 			clk_name[i], clk, clk_get_rate(clk));
 
 	dev_dbg(dev, "BRGCKR = 0x%08x, BRRA/BRRB = 0x%x/0x%x\n",
@@ -595,7 +595,7 @@ static void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct rsnd_adg *adg)
 	 * by BRGCKR::BRGCKR_31
 	 */
 	for_each_rsnd_clkout(clk, adg, i)
-		dev_dbg(dev, "clkout %d : %p : %ld\n", i,
+		dev_dbg(dev, "clkout %d : %pa : %ld\n", i,
 			clk, clk_get_rate(clk));
 }
 #else
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index b5f3bf8..0bbc4b0 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -397,7 +397,7 @@ static void rsnd_dmapp_write(struct rsnd_dma *dma, u32 data, u32 reg)
 	struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
 	struct device *dev = rsnd_priv_to_dev(priv);
 
-	dev_dbg(dev, "w %p : %08x\n", rsnd_dmapp_addr(dmac, dma, reg), data);
+	dev_dbg(dev, "w 0x%px : %08x\n", rsnd_dmapp_addr(dmac, dma, reg), data);
 
 	iowrite32(data, rsnd_dmapp_addr(dmac, dma, reg));
 }
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "ASoC: rsnd: don't use %p for dev_dbg()" to the asoc tree
  2018-09-06  3:22 ` [PATCH 4/4] ASoC: rsnd: don't use %p for dev_dbg() Kuninori Morimoto
@ 2018-09-06 10:44   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-09-06 10:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown, Hiroyuki Yokoyama

The patch

   ASoC: rsnd: don't use %p for dev_dbg()

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From dabdbe3ae0cb9a67872fa4ac80ffdef61391f645 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 6 Sep 2018 03:22:01 +0000
Subject: [PATCH] ASoC: rsnd: don't use %p for dev_dbg()

rsnd driver sometimes want to know which address is used when debugging.
But it will indicate "(____ptrval____)" if it used "%p" on dev_dbg().
Let's use "%pa" or "%px" for it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/adg.c | 4 ++--
 sound/soc/sh/rcar/dma.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 3a3064dda57f..b100c44ec3a3 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -577,7 +577,7 @@ static void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct rsnd_adg *adg)
 	int i;
 
 	for_each_rsnd_clk(clk, adg, i)
-		dev_dbg(dev, "%s    : %p : %ld\n",
+		dev_dbg(dev, "%s    : %pa : %ld\n",
 			clk_name[i], clk, clk_get_rate(clk));
 
 	dev_dbg(dev, "BRGCKR = 0x%08x, BRRA/BRRB = 0x%x/0x%x\n",
@@ -590,7 +590,7 @@ static void rsnd_adg_clk_dbg_info(struct rsnd_priv *priv, struct rsnd_adg *adg)
 	 * by BRGCKR::BRGCKR_31
 	 */
 	for_each_rsnd_clkout(clk, adg, i)
-		dev_dbg(dev, "clkout %d : %p : %ld\n", i,
+		dev_dbg(dev, "clkout %d : %pa : %ld\n", i,
 			clk, clk_get_rate(clk));
 }
 #else
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index f99c1ab3b0bd..c19342d18998 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -393,7 +393,7 @@ static void rsnd_dmapp_write(struct rsnd_dma *dma, u32 data, u32 reg)
 	struct rsnd_dma_ctrl *dmac = rsnd_priv_to_dmac(priv);
 	struct device *dev = rsnd_priv_to_dev(priv);
 
-	dev_dbg(dev, "w %p : %08x\n", rsnd_dmapp_addr(dmac, dma, reg), data);
+	dev_dbg(dev, "w 0x%px : %08x\n", rsnd_dmapp_addr(dmac, dma, reg), data);
 
 	iowrite32(data, rsnd_dmapp_addr(dmac, dma, reg));
 }
-- 
2.19.0.rc1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER" to the asoc tree
  2018-09-06  3:21 ` [PATCH 3/4] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Kuninori Morimoto
@ 2018-09-06 10:44   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-09-06 10:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 6c92d5a2744e27619a8fcc9d74b91ee9f1cdebd1 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 6 Sep 2018 03:21:47 +0000
Subject: [PATCH] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER

Current rsnd driver will fallback to PIO mode if it can't get DMA
handler. But, DMA might return -EPROBE_DEFER when probe timing.
This driver always fallback to PIO mode especially from
commit ac6bbf0cdf4206c ("iommu: Remove IOMMU_OF_DECLARE") because
of this reason.

The DMA driver will be probed later, but sound driver might be
probed as PIO mode in such case. This patch fixup this issue.
Then, -EPROBE_DEFER is not error. Thus, let's don't indicate error
message in such case.
And it needs to call rsnd_adg_remove() individually if probe failed,
because it registers clk which should be unregister.

Maybe PIO fallback feature itself is not needed,
but let's keep it so far.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/core.c | 10 +++++++++-
 sound/soc/sh/rcar/dma.c  |  4 ++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c
index b35f5509cfe2..d23c2bbff0cf 100644
--- a/sound/soc/sh/rcar/core.c
+++ b/sound/soc/sh/rcar/core.c
@@ -478,7 +478,7 @@ static int rsnd_status_update(u32 *status,
 			(func_call && (mod)->ops->fn) ? #fn : "");	\
 		if (func_call && (mod)->ops->fn)			\
 			tmp = (mod)->ops->fn(mod, io, param);		\
-		if (tmp)						\
+		if (tmp && (tmp != -EPROBE_DEFER))			\
 			dev_err(dev, "%s[%d] : %s error %d\n",		\
 				rsnd_mod_name(mod), rsnd_mod_id(mod),	\
 						     #fn, tmp);		\
@@ -1561,6 +1561,14 @@ static int rsnd_probe(struct platform_device *pdev)
 		rsnd_dai_call(remove, &rdai->capture, priv);
 	}
 
+	/*
+	 * adg is very special mod which can't use rsnd_dai_call(remove),
+	 * and it registers ADG clock on probe.
+	 * It should be unregister if probe failed.
+	 * Mainly it is assuming -EPROBE_DEFER case
+	 */
+	rsnd_adg_remove(priv);
+
 	return ret;
 }
 
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index fe63ef8600d0..d65ea7bc4dac 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -241,6 +241,10 @@ static int rsnd_dmaen_attach(struct rsnd_dai_stream *io,
 	/* try to get DMAEngine channel */
 	chan = rsnd_dmaen_request_channel(io, mod_from, mod_to);
 	if (IS_ERR_OR_NULL(chan)) {
+		/* Let's follow when -EPROBE_DEFER case */
+		if (PTR_ERR(chan) == -EPROBE_DEFER)
+			return PTR_ERR(chan);
+
 		/*
 		 * DMA failed. try to PIO mode
 		 * see
-- 
2.19.0.rc1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "ASoC: rsnd: adg: care clock-frequency size" to the asoc tree
  2018-09-06  3:21 ` [PATCH 2/4] ASoC: rsnd: adg: care clock-frequency size Kuninori Morimoto
@ 2018-09-06 10:44   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-09-06 10:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown, Hiroyuki Yokoyama

The patch

   ASoC: rsnd: adg: care clock-frequency size

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 69235ccf491d2e26aefd465c0d3ccd1e3b2a9a9c Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 6 Sep 2018 03:21:33 +0000
Subject: [PATCH] ASoC: rsnd: adg: care clock-frequency size

ADG has buffer over flow bug if DT has more than 3 clock-frequency.
This patch fixup this issue, and uses first 2 values.

	clock-frequency = <x y>;	/* this is OK */
	clock-frequency = <x y z>;	/* this is NG */

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/adg.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c
index 3a3064dda57f..051f96405346 100644
--- a/sound/soc/sh/rcar/adg.c
+++ b/sound/soc/sh/rcar/adg.c
@@ -462,6 +462,11 @@ static void rsnd_adg_get_clkout(struct rsnd_priv *priv,
 		goto rsnd_adg_get_clkout_end;
 
 	req_size = prop->length / sizeof(u32);
+	if (req_size > REQ_SIZE) {
+		dev_err(dev,
+			"too many clock-frequency, use top %d\n", REQ_SIZE);
+		req_size = REQ_SIZE;
+	}
 
 	of_property_read_u32_array(np, "clock-frequency", req_rate, req_size);
 	req_48kHz_rate = 0;
-- 
2.19.0.rc1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Applied "ASoC: rsnd: gen: use tab instead of white-space" to the asoc tree
  2018-09-06  3:21 ` [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space Kuninori Morimoto
@ 2018-09-06 10:44   ` Mark Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2018-09-06 10:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: alsa-devel, Mark Brown

The patch

   ASoC: rsnd: gen: use tab instead of white-space

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 501683d0cd54714de78501efe945bbe4356b922b Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Thu, 6 Sep 2018 03:21:16 +0000
Subject: [PATCH] ASoC: rsnd: gen: use tab instead of white-space

commit 8c9d75033340 ("ASoC: rsnd: ssiu: Support BUSIF
other than BUSIF0") added new SSIU registers.
But it is using white-space for it.
This patch fixup it to use tab.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/gen.c | 48 ++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index 3032869a7f26..1f7881cc16b2 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -222,30 +222,30 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)
 		RSND_GEN_M_REG(SSI_BUSIF0_MODE,		0x0,	0x80),
 		RSND_GEN_M_REG(SSI_BUSIF0_ADINR,	0x4,	0x80),
 		RSND_GEN_M_REG(SSI_BUSIF0_DALIGN,	0x8,	0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_MODE,         0x20,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_ADINR,        0x24,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF1_DALIGN,       0x28,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_MODE,         0x40,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_ADINR,        0x44,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF2_DALIGN,       0x48,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_MODE,         0x60,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_ADINR,        0x64,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF3_DALIGN,       0x68,   0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_MODE,         0x500,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_ADINR,        0x504,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF4_DALIGN,       0x508,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_MODE,         0x520,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_ADINR,        0x524,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF5_DALIGN,       0x528,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_MODE,         0x540,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_ADINR,        0x544,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF6_DALIGN,       0x548,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_MODE,         0x560,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_ADINR,        0x564,  0x80),
-		RSND_GEN_M_REG(SSI_BUSIF7_DALIGN,       0x568,  0x80),
-		RSND_GEN_M_REG(SSI_MODE,	0xc,	0x80),
-		RSND_GEN_M_REG(SSI_CTRL,	0x10,	0x80),
-		RSND_GEN_M_REG(SSI_INT_ENABLE,	0x18,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_MODE,		0x20,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_ADINR,	0x24,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF1_DALIGN,	0x28,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_MODE,		0x40,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_ADINR,	0x44,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF2_DALIGN,	0x48,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_MODE,		0x60,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_ADINR,	0x64,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF3_DALIGN,	0x68,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_MODE,		0x500,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_ADINR,	0x504,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF4_DALIGN,	0x508,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_MODE,		0x520,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_ADINR,	0x524,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF5_DALIGN,	0x528,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_MODE,		0x540,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_ADINR,	0x544,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF6_DALIGN,	0x548,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_MODE,		0x560,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_ADINR,	0x564,	0x80),
+		RSND_GEN_M_REG(SSI_BUSIF7_DALIGN,	0x568,	0x80),
+		RSND_GEN_M_REG(SSI_MODE,		0xc,	0x80),
+		RSND_GEN_M_REG(SSI_CTRL,		0x10,	0x80),
+		RSND_GEN_M_REG(SSI_INT_ENABLE,		0x18,	0x80),
 	};
 
 	static const struct rsnd_regmap_field_conf conf_scu[] = {
-- 
2.19.0.rc1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-09-06 10:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-06  3:20 [PATCH 0/4] ASoC: rsnd: bugfix patches for linus/master, and v4.20 Kuninori Morimoto
2018-09-06  3:21 ` [PATCH 1/4] ASoC: rsnd: gen: use tab instead of white-space Kuninori Morimoto
2018-09-06 10:44   ` Applied "ASoC: rsnd: gen: use tab instead of white-space" to the asoc tree Mark Brown
2018-09-06  3:21 ` [PATCH 2/4] ASoC: rsnd: adg: care clock-frequency size Kuninori Morimoto
2018-09-06 10:44   ` Applied "ASoC: rsnd: adg: care clock-frequency size" to the asoc tree Mark Brown
2018-09-06  3:21 ` [PATCH 3/4] ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER Kuninori Morimoto
2018-09-06 10:44   ` Applied "ASoC: rsnd: don't fallback to PIO mode when -EPROBE_DEFER" to the asoc tree Mark Brown
2018-09-06  3:22 ` [PATCH 4/4] ASoC: rsnd: don't use %p for dev_dbg() Kuninori Morimoto
2018-09-06 10:44   ` Applied "ASoC: rsnd: don't use %p for dev_dbg()" to the asoc tree Mark Brown

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.