All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-08  7:47 ` Yongbo Zhang
  0 siblings, 0 replies; 14+ messages in thread
From: Yongbo Zhang @ 2020-05-08  7:47 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: alsa-devel, linux-renesas-soc, linux-kernel, Yongbo Zhang,
	Kuninori Morimoto, Chen Li

SSI BUSIF buffer is possible to overflow or underflow, especially in a
hypervisor environment. If there is no interrupt support, it will eventually
lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Chen Li <licheng0822@thundersoft.com>
Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
Tested-by: Chen Li <licheng0822@thundersoft.com>
---
 sound/soc/sh/rcar/gen.c  |   8 +++
 sound/soc/sh/rcar/rsnd.h |   9 +++
 sound/soc/sh/rcar/ssi.c  | 142 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 159 insertions(+)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index af19010b9d88..8bd49c8a9517 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -224,6 +224,14 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)
 		RSND_GEN_S_REG(SSI_SYS_STATUS5,	0x884),
 		RSND_GEN_S_REG(SSI_SYS_STATUS6,	0x888),
 		RSND_GEN_S_REG(SSI_SYS_STATUS7,	0x88c),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE1, 0x854),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE3, 0x85c),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE5, 0x894),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE7, 0x89c),
 		RSND_GEN_S_REG(HDMI0_SEL,	0x9e0),
 		RSND_GEN_S_REG(HDMI1_SEL,	0x9e4),
 
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index ea6cbaa9743e..d47608ff5fac 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -189,6 +189,14 @@ enum rsnd_reg {
 	SSI_SYS_STATUS5,
 	SSI_SYS_STATUS6,
 	SSI_SYS_STATUS7,
+	SSI_SYS_INT_ENABLE0,
+	SSI_SYS_INT_ENABLE1,
+	SSI_SYS_INT_ENABLE2,
+	SSI_SYS_INT_ENABLE3,
+	SSI_SYS_INT_ENABLE4,
+	SSI_SYS_INT_ENABLE5,
+	SSI_SYS_INT_ENABLE6,
+	SSI_SYS_INT_ENABLE7,
 	HDMI0_SEL,
 	HDMI1_SEL,
 	SSI9_BUSIF0_MODE,
@@ -237,6 +245,7 @@ enum rsnd_reg {
 #define SSI9_BUSIF_ADINR(i)	(SSI9_BUSIF0_ADINR + (i))
 #define SSI9_BUSIF_DALIGN(i)	(SSI9_BUSIF0_DALIGN + (i))
 #define SSI_SYS_STATUS(i)	(SSI_SYS_STATUS0 + (i))
+#define SSI_SYS_INT_ENABLE(i) (SSI_SYS_INT_ENABLE0 + (i))
 
 
 struct rsnd_priv;
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 4a7d3413917f..178f50a91b3e 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -372,6 +372,9 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
 	u32 wsr		= ssi->wsr;
 	int width;
 	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+	int i;
+	u32 sys_int_enable = 0;
 
 	is_tdm		= rsnd_runtime_is_tdm(io);
 	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
@@ -447,6 +450,38 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
 		cr_mode = DIEN;		/* PIO : enable Data interrupt */
 	}
 
+	/* enable busif buffer over/under run interrupt. */
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE(i * 2));
+				sys_int_enable |= 0xf << (id * 4);
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE(i * 2),
+					       sys_int_enable);
+			}
+
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE((i * 2) + 1));
+				sys_int_enable |= 0xf << 4;
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE((i * 2) + 1),
+					       sys_int_enable);
+			}
+
+			break;
+		}
+	}
+
 init_end:
 	ssi->cr_own	= cr_own;
 	ssi->cr_mode	= cr_mode;
@@ -496,6 +531,13 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
 {
 	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
 	struct device *dev = rsnd_priv_to_dev(priv);
+	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+	int i;
+	u32 sys_int_enable = 0;
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	if (!rsnd_ssi_is_run_mods(mod, io))
 		return 0;
@@ -517,6 +559,37 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
 		ssi->wsr	= 0;
 	}
 
+	/* disable busif buffer over/under run interrupt. */
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+						SSI_SYS_INT_ENABLE(i * 2));
+				sys_int_enable &= ~(0xf << (id * 4));
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE(i * 2),
+					       sys_int_enable);
+			}
+
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE((i * 2) + 1));
+				sys_int_enable &= ~(0xf << 4);
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE((i * 2) + 1),
+					       sys_int_enable);
+			}
+
+			break;
+		}
+
 	return 0;
 }
 
@@ -622,6 +695,11 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
 			int enable)
 {
 	u32 val = 0;
+	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	if (rsnd_is_gen1(priv))
 		return 0;
@@ -635,6 +713,19 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
 	if (enable)
 		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
 
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+		case 9:
+			val |= 0xff00;
+			break;
+		}
+	}
+
 	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
 
 	return 0;
@@ -651,6 +742,10 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
 	u32 status;
 	bool elapsed = false;
 	bool stop = false;
+	int is_tdm, is_tdm_split;
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	spin_lock(&priv->lock);
 
@@ -672,6 +767,53 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
 		stop = true;
 	}
 
+	status = 0;
+
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				status = rsnd_mod_read(mod,
+						       SSI_SYS_STATUS(i * 2));
+				status &= 0xf << (id * 4);
+
+				if (status) {
+					rsnd_dbg_irq_status(dev,
+						"%s err status : 0x%08x\n",
+						rsnd_mod_name(mod), status);
+					rsnd_mod_write(mod,
+						       SSI_SYS_STATUS(i * 2),
+						       0xf << (id * 4));
+					stop = true;
+					break;
+				}
+			}
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				status = rsnd_mod_write(mod,
+						SSI_SYS_STATUS((i * 2) + 1));
+				status &= 0xf << 4;
+
+				if (status) {
+					rsnd_dbg_irq_status(dev,
+						"%s err status : 0x%08x\n",
+						rsnd_mod_name(mod), status);
+					rsnd_mod_write(mod,
+						SSI_SYS_STATUS((i * 2) + 1),
+						0xf << 4);
+					stop = true;
+					break;
+				}
+			}
+			break;
+		}
+	}
+
 	rsnd_ssi_status_clear(mod);
 rsnd_ssi_interrupt_out:
 	spin_unlock(&priv->lock);
-- 
2.26.2


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

* [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-08  7:47 ` Yongbo Zhang
  0 siblings, 0 replies; 14+ messages in thread
From: Yongbo Zhang @ 2020-05-08  7:47 UTC (permalink / raw)
  To: broonie, lgirdwood
  Cc: Chen Li, alsa-devel, Kuninori Morimoto, linux-kernel,
	linux-renesas-soc, Yongbo Zhang

SSI BUSIF buffer is possible to overflow or underflow, especially in a
hypervisor environment. If there is no interrupt support, it will eventually
lead to errors in pcm data.
This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reported-by: Chen Li <licheng0822@thundersoft.com>
Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
Tested-by: Chen Li <licheng0822@thundersoft.com>
---
 sound/soc/sh/rcar/gen.c  |   8 +++
 sound/soc/sh/rcar/rsnd.h |   9 +++
 sound/soc/sh/rcar/ssi.c  | 142 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 159 insertions(+)

diff --git a/sound/soc/sh/rcar/gen.c b/sound/soc/sh/rcar/gen.c
index af19010b9d88..8bd49c8a9517 100644
--- a/sound/soc/sh/rcar/gen.c
+++ b/sound/soc/sh/rcar/gen.c
@@ -224,6 +224,14 @@ static int rsnd_gen2_probe(struct rsnd_priv *priv)
 		RSND_GEN_S_REG(SSI_SYS_STATUS5,	0x884),
 		RSND_GEN_S_REG(SSI_SYS_STATUS6,	0x888),
 		RSND_GEN_S_REG(SSI_SYS_STATUS7,	0x88c),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE0, 0x850),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE1, 0x854),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE2, 0x858),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE3, 0x85c),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE4, 0x890),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE5, 0x894),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE6, 0x898),
+		RSND_GEN_S_REG(SSI_SYS_INT_ENABLE7, 0x89c),
 		RSND_GEN_S_REG(HDMI0_SEL,	0x9e0),
 		RSND_GEN_S_REG(HDMI1_SEL,	0x9e4),
 
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h
index ea6cbaa9743e..d47608ff5fac 100644
--- a/sound/soc/sh/rcar/rsnd.h
+++ b/sound/soc/sh/rcar/rsnd.h
@@ -189,6 +189,14 @@ enum rsnd_reg {
 	SSI_SYS_STATUS5,
 	SSI_SYS_STATUS6,
 	SSI_SYS_STATUS7,
+	SSI_SYS_INT_ENABLE0,
+	SSI_SYS_INT_ENABLE1,
+	SSI_SYS_INT_ENABLE2,
+	SSI_SYS_INT_ENABLE3,
+	SSI_SYS_INT_ENABLE4,
+	SSI_SYS_INT_ENABLE5,
+	SSI_SYS_INT_ENABLE6,
+	SSI_SYS_INT_ENABLE7,
 	HDMI0_SEL,
 	HDMI1_SEL,
 	SSI9_BUSIF0_MODE,
@@ -237,6 +245,7 @@ enum rsnd_reg {
 #define SSI9_BUSIF_ADINR(i)	(SSI9_BUSIF0_ADINR + (i))
 #define SSI9_BUSIF_DALIGN(i)	(SSI9_BUSIF0_DALIGN + (i))
 #define SSI_SYS_STATUS(i)	(SSI_SYS_STATUS0 + (i))
+#define SSI_SYS_INT_ENABLE(i) (SSI_SYS_INT_ENABLE0 + (i))
 
 
 struct rsnd_priv;
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c
index 4a7d3413917f..178f50a91b3e 100644
--- a/sound/soc/sh/rcar/ssi.c
+++ b/sound/soc/sh/rcar/ssi.c
@@ -372,6 +372,9 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
 	u32 wsr		= ssi->wsr;
 	int width;
 	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+	int i;
+	u32 sys_int_enable = 0;
 
 	is_tdm		= rsnd_runtime_is_tdm(io);
 	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
@@ -447,6 +450,38 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,
 		cr_mode = DIEN;		/* PIO : enable Data interrupt */
 	}
 
+	/* enable busif buffer over/under run interrupt. */
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE(i * 2));
+				sys_int_enable |= 0xf << (id * 4);
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE(i * 2),
+					       sys_int_enable);
+			}
+
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE((i * 2) + 1));
+				sys_int_enable |= 0xf << 4;
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE((i * 2) + 1),
+					       sys_int_enable);
+			}
+
+			break;
+		}
+	}
+
 init_end:
 	ssi->cr_own	= cr_own;
 	ssi->cr_mode	= cr_mode;
@@ -496,6 +531,13 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
 {
 	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
 	struct device *dev = rsnd_priv_to_dev(priv);
+	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+	int i;
+	u32 sys_int_enable = 0;
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	if (!rsnd_ssi_is_run_mods(mod, io))
 		return 0;
@@ -517,6 +559,37 @@ static int rsnd_ssi_quit(struct rsnd_mod *mod,
 		ssi->wsr	= 0;
 	}
 
+	/* disable busif buffer over/under run interrupt. */
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+						SSI_SYS_INT_ENABLE(i * 2));
+				sys_int_enable &= ~(0xf << (id * 4));
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE(i * 2),
+					       sys_int_enable);
+			}
+
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				sys_int_enable = rsnd_mod_read(mod,
+					SSI_SYS_INT_ENABLE((i * 2) + 1));
+				sys_int_enable &= ~(0xf << 4);
+				rsnd_mod_write(mod,
+					       SSI_SYS_INT_ENABLE((i * 2) + 1),
+					       sys_int_enable);
+			}
+
+			break;
+		}
+
 	return 0;
 }
 
@@ -622,6 +695,11 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
 			int enable)
 {
 	u32 val = 0;
+	int is_tdm, is_tdm_split;
+	int id = rsnd_mod_id(mod);
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	if (rsnd_is_gen1(priv))
 		return 0;
@@ -635,6 +713,19 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
 	if (enable)
 		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
 
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+		case 9:
+			val |= 0xff00;
+			break;
+		}
+	}
+
 	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
 
 	return 0;
@@ -651,6 +742,10 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
 	u32 status;
 	bool elapsed = false;
 	bool stop = false;
+	int is_tdm, is_tdm_split;
+
+	is_tdm		= rsnd_runtime_is_tdm(io);
+	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
 
 	spin_lock(&priv->lock);
 
@@ -672,6 +767,53 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
 		stop = true;
 	}
 
+	status = 0;
+
+	if (is_tdm || is_tdm_split) {
+		switch (id) {
+		case 0:
+		case 1:
+		case 2:
+		case 3:
+		case 4:
+			for (i = 0; i < 4; i++) {
+				status = rsnd_mod_read(mod,
+						       SSI_SYS_STATUS(i * 2));
+				status &= 0xf << (id * 4);
+
+				if (status) {
+					rsnd_dbg_irq_status(dev,
+						"%s err status : 0x%08x\n",
+						rsnd_mod_name(mod), status);
+					rsnd_mod_write(mod,
+						       SSI_SYS_STATUS(i * 2),
+						       0xf << (id * 4));
+					stop = true;
+					break;
+				}
+			}
+			break;
+		case 9:
+			for (i = 0; i < 4; i++) {
+				status = rsnd_mod_write(mod,
+						SSI_SYS_STATUS((i * 2) + 1));
+				status &= 0xf << 4;
+
+				if (status) {
+					rsnd_dbg_irq_status(dev,
+						"%s err status : 0x%08x\n",
+						rsnd_mod_name(mod), status);
+					rsnd_mod_write(mod,
+						SSI_SYS_STATUS((i * 2) + 1),
+						0xf << 4);
+					stop = true;
+					break;
+				}
+			}
+			break;
+		}
+	}
+
 	rsnd_ssi_status_clear(mod);
 rsnd_ssi_interrupt_out:
 	spin_unlock(&priv->lock);
-- 
2.26.2


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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
  2020-05-08  7:47 ` Yongbo Zhang
  (?)
@ 2020-05-08 23:56   ` kbuild test robot
  -1 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-08 23:56 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: kbuild-all, clang-built-linux, alsa-devel, linux-renesas-soc,
	linux-kernel, Yongbo Zhang, Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 20431 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: arm-defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 6d2a66b10d458e34c852be46028092d2b46edc14)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> sound/soc/sh/rcar/ssi.c:600:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:618:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:651:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:696:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:734:1: error: function declared in block scope cannot have 'static' storage class
   static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
   ^
   sound/soc/sh/rcar/ssi.c:738:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:830:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:841:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:878:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:909:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:923:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:966:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:989:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1033:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1051:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1063:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:1069:12: error: use of undeclared identifier 'rsnd_ssi_common_probe'
           .probe          = rsnd_ssi_common_probe,
                             ^
>> sound/soc/sh/rcar/ssi.c:1070:13: error: use of undeclared identifier 'rsnd_ssi_common_remove'
           .remove         = rsnd_ssi_common_remove,
                             ^
>> sound/soc/sh/rcar/ssi.c:1071:11: error: use of undeclared identifier 'rsnd_ssi_pio_init'
           .init           = rsnd_ssi_pio_init,
                             ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.

vim +600 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10  596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10 @600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26  615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27 @618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 600 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51794 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-08 23:56   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-08 23:56 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: alsa-devel, kbuild-all, Kuninori Morimoto, linux-kernel,
	linux-renesas-soc, clang-built-linux, Yongbo Zhang

[-- Attachment #1: Type: text/plain, Size: 20431 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: arm-defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 6d2a66b10d458e34c852be46028092d2b46edc14)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> sound/soc/sh/rcar/ssi.c:600:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:618:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:651:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:696:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:734:1: error: function declared in block scope cannot have 'static' storage class
   static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
   ^
   sound/soc/sh/rcar/ssi.c:738:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:830:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:841:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:878:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:909:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:923:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:966:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:989:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1033:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1051:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1063:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:1069:12: error: use of undeclared identifier 'rsnd_ssi_common_probe'
           .probe          = rsnd_ssi_common_probe,
                             ^
>> sound/soc/sh/rcar/ssi.c:1070:13: error: use of undeclared identifier 'rsnd_ssi_common_remove'
           .remove         = rsnd_ssi_common_remove,
                             ^
>> sound/soc/sh/rcar/ssi.c:1071:11: error: use of undeclared identifier 'rsnd_ssi_pio_init'
           .init           = rsnd_ssi_pio_init,
                             ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.

vim +600 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10  596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10 @600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26  615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27 @618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 600 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 51794 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-08 23:56   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-08 23:56 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 20764 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: arm-defconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 6d2a66b10d458e34c852be46028092d2b46edc14)
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> sound/soc/sh/rcar/ssi.c:600:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:618:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:651:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:696:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:734:1: error: function declared in block scope cannot have 'static' storage class
   static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
   ^
   sound/soc/sh/rcar/ssi.c:738:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:830:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:841:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:878:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:909:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:923:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:966:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:989:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1033:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1051:1: error: function definition is not allowed here
   {
   ^
   sound/soc/sh/rcar/ssi.c:1063:1: error: function definition is not allowed here
   {
   ^
>> sound/soc/sh/rcar/ssi.c:1069:12: error: use of undeclared identifier 'rsnd_ssi_common_probe'
           .probe          = rsnd_ssi_common_probe,
                             ^
>> sound/soc/sh/rcar/ssi.c:1070:13: error: use of undeclared identifier 'rsnd_ssi_common_remove'
           .remove         = rsnd_ssi_common_remove,
                             ^
>> sound/soc/sh/rcar/ssi.c:1071:11: error: use of undeclared identifier 'rsnd_ssi_pio_init'
           .init           = rsnd_ssi_pio_init,
                             ^
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.

vim +600 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10  596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10 @600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26  615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27 @618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 600 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 51794 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
  2020-05-08  7:47 ` Yongbo Zhang
  (?)
@ 2020-05-09 11:07   ` kbuild test robot
  -1 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-09 11:07 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: kbuild-all, alsa-devel, linux-renesas-soc, linux-kernel,
	Yongbo Zhang, Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 31207 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
>> sound/soc/sh/rcar/ssi.c:596:12: error: invalid storage class for function 'rsnd_ssi_hw_params'
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:596:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         | ^~~~~~
>> sound/soc/sh/rcar/ssi.c:615:12: error: invalid storage class for function 'rsnd_ssi_start'
     615 | static int rsnd_ssi_start(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:648:12: error: invalid storage class for function 'rsnd_ssi_stop'
     648 | static int rsnd_ssi_stop(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:692:12: error: invalid storage class for function 'rsnd_ssi_irq'
     692 | static int rsnd_ssi_irq(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:734:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     734 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:736:13: error: invalid storage class for function '__rsnd_ssi_interrupt'
     736 | static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function '__rsnd_ssi_interrupt':
   sound/soc/sh/rcar/ssi.c:760:13: error: implicit declaration of function 'rsnd_ssi_pio_interrupt'; did you mean 'rsnd_mod_interrupt'? [-Werror=implicit-function-declaration]
     760 |   elapsed = rsnd_ssi_pio_interrupt(mod, io);
         |             ^~~~~~~~~~~~~~~~~~~~~~
         |             rsnd_mod_interrupt
   sound/soc/sh/rcar/ssi.c:798:14: error: too few arguments to function 'rsnd_mod_write'
     798 |     status = rsnd_mod_write(mod,
         |              ^~~~~~~~~~~~~~
   In file included from sound/soc/sh/rcar/ssi.c:21:
   sound/soc/sh/rcar/rsnd.h:260:6: note: declared here
     260 | void rsnd_mod_write(struct rsnd_mod *mod, enum rsnd_reg reg, u32 data);
         |      ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
   sound/soc/sh/rcar/ssi.c:829:20: error: invalid storage class for function 'rsnd_ssi_interrupt'
     829 | static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
         |                    ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:838:13: error: invalid storage class for function 'rsnd_ssi_get_status'
     838 | static u32 *rsnd_ssi_get_status(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:876:13: error: invalid storage class for function 'rsnd_ssi_parent_attach'
     876 | static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:906:12: error: invalid storage class for function 'rsnd_ssi_pcm_new'
     906 | static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:920:12: error: invalid storage class for function 'rsnd_ssi_common_probe'
     920 | static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:963:12: error: invalid storage class for function 'rsnd_ssi_common_remove'
     963 | static int rsnd_ssi_common_remove(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1030:12: error: invalid storage class for function 'rsnd_ssi_pio_init'
    1030 | static int rsnd_ssi_pio_init(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1048:12: error: invalid storage class for function 'rsnd_ssi_pio_pointer'
    1048 | static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1060:12: error: invalid storage class for function 'rsnd_ssi_prepare'
    1060 | static int rsnd_ssi_prepare(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1069:12: error: initializer element is not constant
    1069 |  .probe  = rsnd_ssi_common_probe,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1069:12: note: (near initialization for 'rsnd_ssi_pio_ops.probe')
   sound/soc/sh/rcar/ssi.c:1070:13: error: initializer element is not constant
    1070 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1070:13: note: (near initialization for 'rsnd_ssi_pio_ops.remove')
   sound/soc/sh/rcar/ssi.c:1071:11: error: initializer element is not constant
    1071 |  .init  = rsnd_ssi_pio_init,
         |           ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1071:11: note: (near initialization for 'rsnd_ssi_pio_ops.init')
   sound/soc/sh/rcar/ssi.c:1073:12: error: initializer element is not constant
    1073 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1073:12: note: (near initialization for 'rsnd_ssi_pio_ops.start')
   sound/soc/sh/rcar/ssi.c:1074:11: error: initializer element is not constant
    1074 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1074:11: note: (near initialization for 'rsnd_ssi_pio_ops.stop')
   sound/soc/sh/rcar/ssi.c:1075:10: error: initializer element is not constant
    1075 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1075:10: note: (near initialization for 'rsnd_ssi_pio_ops.irq')
   sound/soc/sh/rcar/ssi.c:1076:13: error: initializer element is not constant
    1076 |  .pointer = rsnd_ssi_pio_pointer,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1076:13: note: (near initialization for 'rsnd_ssi_pio_ops.pointer')
   sound/soc/sh/rcar/ssi.c:1077:13: error: initializer element is not constant
    1077 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1077:13: note: (near initialization for 'rsnd_ssi_pio_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1078:15: error: initializer element is not constant
    1078 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1078:15: note: (near initialization for 'rsnd_ssi_pio_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1079:13: error: initializer element is not constant
    1079 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1079:13: note: (near initialization for 'rsnd_ssi_pio_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1080:16: error: initializer element is not constant
    1080 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1080:16: note: (near initialization for 'rsnd_ssi_pio_ops.get_status')
>> sound/soc/sh/rcar/ssi.c:1083:12: error: invalid storage class for function 'rsnd_ssi_dma_probe'
    1083 | static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1106:12: error: invalid storage class for function 'rsnd_ssi_fallback'
    1106 | static int rsnd_ssi_fallback(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1126:25: error: invalid storage class for function 'rsnd_ssi_dma_req'
    1126 | static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
         |                         ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: error: initializer element is not constant
    1155 |  .dma_req = rsnd_ssi_dma_req,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: note: (near initialization for 'rsnd_ssi_dma_ops.dma_req')
   sound/soc/sh/rcar/ssi.c:1156:12: error: initializer element is not constant
    1156 |  .probe  = rsnd_ssi_dma_probe,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1156:12: note: (near initialization for 'rsnd_ssi_dma_ops.probe')
   sound/soc/sh/rcar/ssi.c:1157:13: error: initializer element is not constant
    1157 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1157:13: note: (near initialization for 'rsnd_ssi_dma_ops.remove')
   sound/soc/sh/rcar/ssi.c:1160:12: error: initializer element is not constant
    1160 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1160:12: note: (near initialization for 'rsnd_ssi_dma_ops.start')
   sound/soc/sh/rcar/ssi.c:1161:11: error: initializer element is not constant
    1161 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1161:11: note: (near initialization for 'rsnd_ssi_dma_ops.stop')
   sound/soc/sh/rcar/ssi.c:1162:10: error: initializer element is not constant
    1162 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1162:10: note: (near initialization for 'rsnd_ssi_dma_ops.irq')
   sound/soc/sh/rcar/ssi.c:1163:13: error: initializer element is not constant
    1163 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1163:13: note: (near initialization for 'rsnd_ssi_dma_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1164:14: error: initializer element is not constant
    1164 |  .fallback = rsnd_ssi_fallback,
         |              ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1164:14: note: (near initialization for 'rsnd_ssi_dma_ops.fallback')
   sound/soc/sh/rcar/ssi.c:1165:15: error: initializer element is not constant
    1165 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1165:15: note: (near initialization for 'rsnd_ssi_dma_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1166:13: error: initializer element is not constant
    1166 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1166:13: note: (near initialization for 'rsnd_ssi_dma_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1167:16: error: initializer element is not constant
    1167 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1167:16: note: (near initialization for 'rsnd_ssi_dma_ops.get_status')
   sound/soc/sh/rcar/ssi.c:1170:12: error: invalid storage class for function 'rsnd_ssi_is_dma_mode'
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1178:13: error: invalid storage class for function 'rsnd_ssi_connect'
    1178 | static void rsnd_ssi_connect(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1337:1: error: expected declaration or statement at end of input
    1337 | }
         | ^
   sound/soc/sh/rcar/ssi.c: At top level:
   sound/soc/sh/rcar/ssi.c:120:12: warning: 'rsnd_ssi_is_dma_mode' used but never defined
     120 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1329:6: warning: 'rsnd_ssi_remove' defined but not used [-Wunused-function]
    1329 | void rsnd_ssi_remove(struct rsnd_priv *priv)
         |      ^~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1246:5: warning: 'rsnd_ssi_probe' defined but not used [-Wunused-function]
    1246 | int rsnd_ssi_probe(struct rsnd_priv *priv)
         |     ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1238:5: warning: '__rsnd_ssi_is_pin_sharing' defined but not used [-Wunused-function]
    1238 | int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1230:18: warning: 'rsnd_ssi_mod_get' defined but not used [-Wunused-function]
    1230 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
         |                  ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1203:6: warning: 'rsnd_parse_connect_ssi' defined but not used [-Wunused-function]
    1203 | void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
         |      ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1170:12: warning: 'rsnd_ssi_is_dma_mode' defined but not used [-Wunused-function]
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: warning: 'rsnd_ssi_pio_interrupt' defined but not used [-Wunused-function]
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:528:12: warning: 'rsnd_ssi_quit' defined but not used [-Wunused-function]
     528 | static int rsnd_ssi_quit(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/rsnd_ssi_hw_params +596 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10 @596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10  600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26 @615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18 @692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 596 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62814 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-09 11:07   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-09 11:07 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: alsa-devel, kbuild-all, Kuninori Morimoto, linux-kernel,
	linux-renesas-soc, Yongbo Zhang

[-- Attachment #1: Type: text/plain, Size: 31207 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
>> sound/soc/sh/rcar/ssi.c:596:12: error: invalid storage class for function 'rsnd_ssi_hw_params'
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:596:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         | ^~~~~~
>> sound/soc/sh/rcar/ssi.c:615:12: error: invalid storage class for function 'rsnd_ssi_start'
     615 | static int rsnd_ssi_start(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:648:12: error: invalid storage class for function 'rsnd_ssi_stop'
     648 | static int rsnd_ssi_stop(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:692:12: error: invalid storage class for function 'rsnd_ssi_irq'
     692 | static int rsnd_ssi_irq(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:734:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     734 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:736:13: error: invalid storage class for function '__rsnd_ssi_interrupt'
     736 | static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function '__rsnd_ssi_interrupt':
   sound/soc/sh/rcar/ssi.c:760:13: error: implicit declaration of function 'rsnd_ssi_pio_interrupt'; did you mean 'rsnd_mod_interrupt'? [-Werror=implicit-function-declaration]
     760 |   elapsed = rsnd_ssi_pio_interrupt(mod, io);
         |             ^~~~~~~~~~~~~~~~~~~~~~
         |             rsnd_mod_interrupt
   sound/soc/sh/rcar/ssi.c:798:14: error: too few arguments to function 'rsnd_mod_write'
     798 |     status = rsnd_mod_write(mod,
         |              ^~~~~~~~~~~~~~
   In file included from sound/soc/sh/rcar/ssi.c:21:
   sound/soc/sh/rcar/rsnd.h:260:6: note: declared here
     260 | void rsnd_mod_write(struct rsnd_mod *mod, enum rsnd_reg reg, u32 data);
         |      ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
   sound/soc/sh/rcar/ssi.c:829:20: error: invalid storage class for function 'rsnd_ssi_interrupt'
     829 | static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
         |                    ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:838:13: error: invalid storage class for function 'rsnd_ssi_get_status'
     838 | static u32 *rsnd_ssi_get_status(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:876:13: error: invalid storage class for function 'rsnd_ssi_parent_attach'
     876 | static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:906:12: error: invalid storage class for function 'rsnd_ssi_pcm_new'
     906 | static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:920:12: error: invalid storage class for function 'rsnd_ssi_common_probe'
     920 | static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:963:12: error: invalid storage class for function 'rsnd_ssi_common_remove'
     963 | static int rsnd_ssi_common_remove(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1030:12: error: invalid storage class for function 'rsnd_ssi_pio_init'
    1030 | static int rsnd_ssi_pio_init(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1048:12: error: invalid storage class for function 'rsnd_ssi_pio_pointer'
    1048 | static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1060:12: error: invalid storage class for function 'rsnd_ssi_prepare'
    1060 | static int rsnd_ssi_prepare(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1069:12: error: initializer element is not constant
    1069 |  .probe  = rsnd_ssi_common_probe,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1069:12: note: (near initialization for 'rsnd_ssi_pio_ops.probe')
   sound/soc/sh/rcar/ssi.c:1070:13: error: initializer element is not constant
    1070 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1070:13: note: (near initialization for 'rsnd_ssi_pio_ops.remove')
   sound/soc/sh/rcar/ssi.c:1071:11: error: initializer element is not constant
    1071 |  .init  = rsnd_ssi_pio_init,
         |           ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1071:11: note: (near initialization for 'rsnd_ssi_pio_ops.init')
   sound/soc/sh/rcar/ssi.c:1073:12: error: initializer element is not constant
    1073 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1073:12: note: (near initialization for 'rsnd_ssi_pio_ops.start')
   sound/soc/sh/rcar/ssi.c:1074:11: error: initializer element is not constant
    1074 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1074:11: note: (near initialization for 'rsnd_ssi_pio_ops.stop')
   sound/soc/sh/rcar/ssi.c:1075:10: error: initializer element is not constant
    1075 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1075:10: note: (near initialization for 'rsnd_ssi_pio_ops.irq')
   sound/soc/sh/rcar/ssi.c:1076:13: error: initializer element is not constant
    1076 |  .pointer = rsnd_ssi_pio_pointer,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1076:13: note: (near initialization for 'rsnd_ssi_pio_ops.pointer')
   sound/soc/sh/rcar/ssi.c:1077:13: error: initializer element is not constant
    1077 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1077:13: note: (near initialization for 'rsnd_ssi_pio_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1078:15: error: initializer element is not constant
    1078 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1078:15: note: (near initialization for 'rsnd_ssi_pio_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1079:13: error: initializer element is not constant
    1079 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1079:13: note: (near initialization for 'rsnd_ssi_pio_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1080:16: error: initializer element is not constant
    1080 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1080:16: note: (near initialization for 'rsnd_ssi_pio_ops.get_status')
>> sound/soc/sh/rcar/ssi.c:1083:12: error: invalid storage class for function 'rsnd_ssi_dma_probe'
    1083 | static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1106:12: error: invalid storage class for function 'rsnd_ssi_fallback'
    1106 | static int rsnd_ssi_fallback(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1126:25: error: invalid storage class for function 'rsnd_ssi_dma_req'
    1126 | static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
         |                         ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: error: initializer element is not constant
    1155 |  .dma_req = rsnd_ssi_dma_req,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: note: (near initialization for 'rsnd_ssi_dma_ops.dma_req')
   sound/soc/sh/rcar/ssi.c:1156:12: error: initializer element is not constant
    1156 |  .probe  = rsnd_ssi_dma_probe,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1156:12: note: (near initialization for 'rsnd_ssi_dma_ops.probe')
   sound/soc/sh/rcar/ssi.c:1157:13: error: initializer element is not constant
    1157 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1157:13: note: (near initialization for 'rsnd_ssi_dma_ops.remove')
   sound/soc/sh/rcar/ssi.c:1160:12: error: initializer element is not constant
    1160 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1160:12: note: (near initialization for 'rsnd_ssi_dma_ops.start')
   sound/soc/sh/rcar/ssi.c:1161:11: error: initializer element is not constant
    1161 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1161:11: note: (near initialization for 'rsnd_ssi_dma_ops.stop')
   sound/soc/sh/rcar/ssi.c:1162:10: error: initializer element is not constant
    1162 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1162:10: note: (near initialization for 'rsnd_ssi_dma_ops.irq')
   sound/soc/sh/rcar/ssi.c:1163:13: error: initializer element is not constant
    1163 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1163:13: note: (near initialization for 'rsnd_ssi_dma_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1164:14: error: initializer element is not constant
    1164 |  .fallback = rsnd_ssi_fallback,
         |              ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1164:14: note: (near initialization for 'rsnd_ssi_dma_ops.fallback')
   sound/soc/sh/rcar/ssi.c:1165:15: error: initializer element is not constant
    1165 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1165:15: note: (near initialization for 'rsnd_ssi_dma_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1166:13: error: initializer element is not constant
    1166 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1166:13: note: (near initialization for 'rsnd_ssi_dma_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1167:16: error: initializer element is not constant
    1167 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1167:16: note: (near initialization for 'rsnd_ssi_dma_ops.get_status')
   sound/soc/sh/rcar/ssi.c:1170:12: error: invalid storage class for function 'rsnd_ssi_is_dma_mode'
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1178:13: error: invalid storage class for function 'rsnd_ssi_connect'
    1178 | static void rsnd_ssi_connect(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1337:1: error: expected declaration or statement at end of input
    1337 | }
         | ^
   sound/soc/sh/rcar/ssi.c: At top level:
   sound/soc/sh/rcar/ssi.c:120:12: warning: 'rsnd_ssi_is_dma_mode' used but never defined
     120 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1329:6: warning: 'rsnd_ssi_remove' defined but not used [-Wunused-function]
    1329 | void rsnd_ssi_remove(struct rsnd_priv *priv)
         |      ^~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1246:5: warning: 'rsnd_ssi_probe' defined but not used [-Wunused-function]
    1246 | int rsnd_ssi_probe(struct rsnd_priv *priv)
         |     ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1238:5: warning: '__rsnd_ssi_is_pin_sharing' defined but not used [-Wunused-function]
    1238 | int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1230:18: warning: 'rsnd_ssi_mod_get' defined but not used [-Wunused-function]
    1230 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
         |                  ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1203:6: warning: 'rsnd_parse_connect_ssi' defined but not used [-Wunused-function]
    1203 | void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
         |      ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1170:12: warning: 'rsnd_ssi_is_dma_mode' defined but not used [-Wunused-function]
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: warning: 'rsnd_ssi_pio_interrupt' defined but not used [-Wunused-function]
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:528:12: warning: 'rsnd_ssi_quit' defined but not used [-Wunused-function]
     528 | static int rsnd_ssi_quit(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/rsnd_ssi_hw_params +596 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10 @596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10  600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26 @615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18 @692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 596 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62814 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-09 11:07   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-09 11:07 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 31679 bytes --]

Hi Yongbo,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: xtensa-allyesconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day GCC_VERSION=9.3.0 make.cross ARCH=xtensa 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
>> sound/soc/sh/rcar/ssi.c:596:12: error: invalid storage class for function 'rsnd_ssi_hw_params'
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:596:1: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
     596 | static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
         | ^~~~~~
>> sound/soc/sh/rcar/ssi.c:615:12: error: invalid storage class for function 'rsnd_ssi_start'
     615 | static int rsnd_ssi_start(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:648:12: error: invalid storage class for function 'rsnd_ssi_stop'
     648 | static int rsnd_ssi_stop(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:692:12: error: invalid storage class for function 'rsnd_ssi_irq'
     692 | static int rsnd_ssi_irq(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:734:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     734 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:736:13: error: invalid storage class for function '__rsnd_ssi_interrupt'
     736 | static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function '__rsnd_ssi_interrupt':
   sound/soc/sh/rcar/ssi.c:760:13: error: implicit declaration of function 'rsnd_ssi_pio_interrupt'; did you mean 'rsnd_mod_interrupt'? [-Werror=implicit-function-declaration]
     760 |   elapsed = rsnd_ssi_pio_interrupt(mod, io);
         |             ^~~~~~~~~~~~~~~~~~~~~~
         |             rsnd_mod_interrupt
   sound/soc/sh/rcar/ssi.c:798:14: error: too few arguments to function 'rsnd_mod_write'
     798 |     status = rsnd_mod_write(mod,
         |              ^~~~~~~~~~~~~~
   In file included from sound/soc/sh/rcar/ssi.c:21:
   sound/soc/sh/rcar/rsnd.h:260:6: note: declared here
     260 | void rsnd_mod_write(struct rsnd_mod *mod, enum rsnd_reg reg, u32 data);
         |      ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c: In function 'rsnd_ssi_quit':
   sound/soc/sh/rcar/ssi.c:829:20: error: invalid storage class for function 'rsnd_ssi_interrupt'
     829 | static irqreturn_t rsnd_ssi_interrupt(int irq, void *data)
         |                    ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:838:13: error: invalid storage class for function 'rsnd_ssi_get_status'
     838 | static u32 *rsnd_ssi_get_status(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:876:13: error: invalid storage class for function 'rsnd_ssi_parent_attach'
     876 | static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:906:12: error: invalid storage class for function 'rsnd_ssi_pcm_new'
     906 | static int rsnd_ssi_pcm_new(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:920:12: error: invalid storage class for function 'rsnd_ssi_common_probe'
     920 | static int rsnd_ssi_common_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:963:12: error: invalid storage class for function 'rsnd_ssi_common_remove'
     963 | static int rsnd_ssi_common_remove(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: error: invalid storage class for function 'rsnd_ssi_pio_interrupt'
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1030:12: error: invalid storage class for function 'rsnd_ssi_pio_init'
    1030 | static int rsnd_ssi_pio_init(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1048:12: error: invalid storage class for function 'rsnd_ssi_pio_pointer'
    1048 | static int rsnd_ssi_pio_pointer(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1060:12: error: invalid storage class for function 'rsnd_ssi_prepare'
    1060 | static int rsnd_ssi_prepare(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1069:12: error: initializer element is not constant
    1069 |  .probe  = rsnd_ssi_common_probe,
         |            ^~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1069:12: note: (near initialization for 'rsnd_ssi_pio_ops.probe')
   sound/soc/sh/rcar/ssi.c:1070:13: error: initializer element is not constant
    1070 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1070:13: note: (near initialization for 'rsnd_ssi_pio_ops.remove')
   sound/soc/sh/rcar/ssi.c:1071:11: error: initializer element is not constant
    1071 |  .init  = rsnd_ssi_pio_init,
         |           ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1071:11: note: (near initialization for 'rsnd_ssi_pio_ops.init')
   sound/soc/sh/rcar/ssi.c:1073:12: error: initializer element is not constant
    1073 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1073:12: note: (near initialization for 'rsnd_ssi_pio_ops.start')
   sound/soc/sh/rcar/ssi.c:1074:11: error: initializer element is not constant
    1074 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1074:11: note: (near initialization for 'rsnd_ssi_pio_ops.stop')
   sound/soc/sh/rcar/ssi.c:1075:10: error: initializer element is not constant
    1075 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1075:10: note: (near initialization for 'rsnd_ssi_pio_ops.irq')
   sound/soc/sh/rcar/ssi.c:1076:13: error: initializer element is not constant
    1076 |  .pointer = rsnd_ssi_pio_pointer,
         |             ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1076:13: note: (near initialization for 'rsnd_ssi_pio_ops.pointer')
   sound/soc/sh/rcar/ssi.c:1077:13: error: initializer element is not constant
    1077 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1077:13: note: (near initialization for 'rsnd_ssi_pio_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1078:15: error: initializer element is not constant
    1078 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1078:15: note: (near initialization for 'rsnd_ssi_pio_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1079:13: error: initializer element is not constant
    1079 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1079:13: note: (near initialization for 'rsnd_ssi_pio_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1080:16: error: initializer element is not constant
    1080 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1080:16: note: (near initialization for 'rsnd_ssi_pio_ops.get_status')
>> sound/soc/sh/rcar/ssi.c:1083:12: error: invalid storage class for function 'rsnd_ssi_dma_probe'
    1083 | static int rsnd_ssi_dma_probe(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1106:12: error: invalid storage class for function 'rsnd_ssi_fallback'
    1106 | static int rsnd_ssi_fallback(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~~~~~
>> sound/soc/sh/rcar/ssi.c:1126:25: error: invalid storage class for function 'rsnd_ssi_dma_req'
    1126 | static struct dma_chan *rsnd_ssi_dma_req(struct rsnd_dai_stream *io,
         |                         ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: error: initializer element is not constant
    1155 |  .dma_req = rsnd_ssi_dma_req,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1155:13: note: (near initialization for 'rsnd_ssi_dma_ops.dma_req')
   sound/soc/sh/rcar/ssi.c:1156:12: error: initializer element is not constant
    1156 |  .probe  = rsnd_ssi_dma_probe,
         |            ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1156:12: note: (near initialization for 'rsnd_ssi_dma_ops.probe')
   sound/soc/sh/rcar/ssi.c:1157:13: error: initializer element is not constant
    1157 |  .remove  = rsnd_ssi_common_remove,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1157:13: note: (near initialization for 'rsnd_ssi_dma_ops.remove')
   sound/soc/sh/rcar/ssi.c:1160:12: error: initializer element is not constant
    1160 |  .start  = rsnd_ssi_start,
         |            ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1160:12: note: (near initialization for 'rsnd_ssi_dma_ops.start')
   sound/soc/sh/rcar/ssi.c:1161:11: error: initializer element is not constant
    1161 |  .stop  = rsnd_ssi_stop,
         |           ^~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1161:11: note: (near initialization for 'rsnd_ssi_dma_ops.stop')
   sound/soc/sh/rcar/ssi.c:1162:10: error: initializer element is not constant
    1162 |  .irq  = rsnd_ssi_irq,
         |          ^~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1162:10: note: (near initialization for 'rsnd_ssi_dma_ops.irq')
   sound/soc/sh/rcar/ssi.c:1163:13: error: initializer element is not constant
    1163 |  .pcm_new = rsnd_ssi_pcm_new,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1163:13: note: (near initialization for 'rsnd_ssi_dma_ops.pcm_new')
   sound/soc/sh/rcar/ssi.c:1164:14: error: initializer element is not constant
    1164 |  .fallback = rsnd_ssi_fallback,
         |              ^~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1164:14: note: (near initialization for 'rsnd_ssi_dma_ops.fallback')
   sound/soc/sh/rcar/ssi.c:1165:15: error: initializer element is not constant
    1165 |  .hw_params = rsnd_ssi_hw_params,
         |               ^~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1165:15: note: (near initialization for 'rsnd_ssi_dma_ops.hw_params')
   sound/soc/sh/rcar/ssi.c:1166:13: error: initializer element is not constant
    1166 |  .prepare = rsnd_ssi_prepare,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1166:13: note: (near initialization for 'rsnd_ssi_dma_ops.prepare')
   sound/soc/sh/rcar/ssi.c:1167:16: error: initializer element is not constant
    1167 |  .get_status = rsnd_ssi_get_status,
         |                ^~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1167:16: note: (near initialization for 'rsnd_ssi_dma_ops.get_status')
   sound/soc/sh/rcar/ssi.c:1170:12: error: invalid storage class for function 'rsnd_ssi_is_dma_mode'
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1178:13: error: invalid storage class for function 'rsnd_ssi_connect'
    1178 | static void rsnd_ssi_connect(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1337:1: error: expected declaration or statement at end of input
    1337 | }
         | ^
   sound/soc/sh/rcar/ssi.c: At top level:
   sound/soc/sh/rcar/ssi.c:120:12: warning: 'rsnd_ssi_is_dma_mode' used but never defined
     120 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1329:6: warning: 'rsnd_ssi_remove' defined but not used [-Wunused-function]
    1329 | void rsnd_ssi_remove(struct rsnd_priv *priv)
         |      ^~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1246:5: warning: 'rsnd_ssi_probe' defined but not used [-Wunused-function]
    1246 | int rsnd_ssi_probe(struct rsnd_priv *priv)
         |     ^~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1238:5: warning: '__rsnd_ssi_is_pin_sharing' defined but not used [-Wunused-function]
    1238 | int __rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1230:18: warning: 'rsnd_ssi_mod_get' defined but not used [-Wunused-function]
    1230 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id)
         |                  ^~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1203:6: warning: 'rsnd_parse_connect_ssi' defined but not used [-Wunused-function]
    1203 | void rsnd_parse_connect_ssi(struct rsnd_dai *rdai,
         |      ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:1170:12: warning: 'rsnd_ssi_is_dma_mode' defined but not used [-Wunused-function]
    1170 | static int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod)
         |            ^~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:987:13: warning: 'rsnd_ssi_pio_interrupt' defined but not used [-Wunused-function]
     987 | static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
         |             ^~~~~~~~~~~~~~~~~~~~~~
   sound/soc/sh/rcar/ssi.c:528:12: warning: 'rsnd_ssi_quit' defined but not used [-Wunused-function]
     528 | static int rsnd_ssi_quit(struct rsnd_mod *mod,
         |            ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/rsnd_ssi_hw_params +596 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto  2013-07-21  595  
919567d914b3c1 Kuninori Morimoto  2015-04-10 @596  static int rsnd_ssi_hw_params(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  597  			      struct rsnd_dai_stream *io,
919567d914b3c1 Kuninori Morimoto  2015-04-10  598  			      struct snd_pcm_substream *substream,
919567d914b3c1 Kuninori Morimoto  2015-04-10  599  			      struct snd_pcm_hw_params *params)
919567d914b3c1 Kuninori Morimoto  2015-04-10  600  {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  601  	struct rsnd_dai *rdai = rsnd_io_to_rdai(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  602  	unsigned int fmt_width = snd_pcm_format_width(params_format(params));
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  603  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  604  	if (fmt_width > rdai->chan_width) {
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  605  		struct rsnd_priv *priv = rsnd_io_to_priv(io);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  606  		struct device *dev = rsnd_priv_to_dev(priv);
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  607  
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  608  		dev_err(dev, "invalid combination of slot-width and format-data-width\n");
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  609  		return -EINVAL;
fb2815f44a9eb3 Dragos Tarcatu     2018-09-03  610  	}
919567d914b3c1 Kuninori Morimoto  2015-04-10  611  
919567d914b3c1 Kuninori Morimoto  2015-04-10  612  	return 0;
919567d914b3c1 Kuninori Morimoto  2015-04-10  613  }
919567d914b3c1 Kuninori Morimoto  2015-04-10  614  
6a25c8da00284f Kuninori Morimoto  2016-01-26 @615  static int rsnd_ssi_start(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto  2015-06-15  616  			  struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto  2015-01-15  617  			  struct rsnd_priv *priv)
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  618  {
597b046f0d99b0 Kuninori Morimoto  2017-08-08  619  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
597b046f0d99b0 Kuninori Morimoto  2017-08-08  620  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  621  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  622  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  623  
b4c83b17155781 Kuninori Morimoto  2015-12-17  624  	/*
b4c83b17155781 Kuninori Morimoto  2015-12-17  625  	 * EN will be set via SSIU :: SSI_CONTROL
b4c83b17155781 Kuninori Morimoto  2015-12-17  626  	 * if Multi channel mode
b4c83b17155781 Kuninori Morimoto  2015-12-17  627  	 */
4f5c634d58e719 Kuninori Morimoto  2016-02-18  628  	if (rsnd_ssi_multi_slaves_runtime(io))
0dc6bf75023a42 Kuninori Morimoto  2016-02-18  629  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  630  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  631  	/*
597b046f0d99b0 Kuninori Morimoto  2017-08-08  632  	 * EN is for data output.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  633  	 * SSI parent EN is not needed.
597b046f0d99b0 Kuninori Morimoto  2017-08-08  634  	 */
0c258657ddfe81 Matthias Blankertz 2020-04-17  635  	if (rsnd_ssi_is_parent(mod, io))
597b046f0d99b0 Kuninori Morimoto  2017-08-08  636  		return 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  637  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  638  	ssi->cr_en = EN;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  639  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  640  	rsnd_mod_write(mod, SSICR,	ssi->cr_own	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  641  					ssi->cr_clk	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  642  					ssi->cr_mode	|
597b046f0d99b0 Kuninori Morimoto  2017-08-08  643  					ssi->cr_en);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  644  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  645  	return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  646  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  647  
6a25c8da00284f Kuninori Morimoto  2016-01-26  648  static int rsnd_ssi_stop(struct rsnd_mod *mod,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  649  			 struct rsnd_dai_stream *io,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  650  			 struct rsnd_priv *priv)
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  651  {
6a25c8da00284f Kuninori Morimoto  2016-01-26  652  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
6a25c8da00284f Kuninori Morimoto  2016-01-26  653  	u32 cr;
6a25c8da00284f Kuninori Morimoto  2016-01-26  654  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  655  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  656  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  657  
0c258657ddfe81 Matthias Blankertz 2020-04-17  658  	if (rsnd_ssi_is_parent(mod, io))
6a25c8da00284f Kuninori Morimoto  2016-01-26  659  		return 0;
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  660  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  661  	cr  =	ssi->cr_own	|
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  662  		ssi->cr_clk;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  663  
ce548931207c0d Kuninori Morimoto  2017-10-31  664  	/*
ce548931207c0d Kuninori Morimoto  2017-10-31  665  	 * disable all IRQ,
ce548931207c0d Kuninori Morimoto  2017-10-31  666  	 * Playback: Wait all data was sent
ce548931207c0d Kuninori Morimoto  2017-10-31  667  	 * Capture:  It might not receave data. Do nothing
ce548931207c0d Kuninori Morimoto  2017-10-31  668  	 */
ce548931207c0d Kuninori Morimoto  2017-10-31  669  	if (rsnd_io_is_play(io)) {
54cb6221688660 Matthias Blankertz 2020-04-17  670  		rsnd_mod_write(mod, SSICR, cr | ssi->cr_en);
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  671  		rsnd_ssi_status_check(mod, DIRQ);
ce548931207c0d Kuninori Morimoto  2017-10-31  672  	}
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  673  
54cb6221688660 Matthias Blankertz 2020-04-17  674  	/* In multi-SSI mode, stop is performed by setting ssi0129 in
54cb6221688660 Matthias Blankertz 2020-04-17  675  	 * SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here.
54cb6221688660 Matthias Blankertz 2020-04-17  676  	 */
54cb6221688660 Matthias Blankertz 2020-04-17  677  	if (rsnd_ssi_multi_slaves_runtime(io))
54cb6221688660 Matthias Blankertz 2020-04-17  678  		return 0;
54cb6221688660 Matthias Blankertz 2020-04-17  679  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  680  	/*
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  681  	 * disable SSI,
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  682  	 * and, wait idle state
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  683  	 */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  684  	rsnd_mod_write(mod, SSICR, cr);	/* disabled all */
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  685  	rsnd_ssi_status_check(mod, IIRQ);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  686  
597b046f0d99b0 Kuninori Morimoto  2017-08-08  687  	ssi->cr_en = 0;
597b046f0d99b0 Kuninori Morimoto  2017-08-08  688  
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  689  	return 0;
e7d850dd10f4e6 Kuninori Morimoto  2015-10-26  690  }
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  691  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18 @692  static int rsnd_ssi_irq(struct rsnd_mod *mod,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  693  			struct rsnd_dai_stream *io,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  694  			struct rsnd_priv *priv,
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  695  			int enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  696  {
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  697  	u32 val = 0;
391d452251464b Yongbo Zhang       2020-05-08  698  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  699  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang       2020-05-08  700  
391d452251464b Yongbo Zhang       2020-05-08  701  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  702  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  703  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  704  	if (rsnd_is_gen1(priv))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  705  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  706  
0c258657ddfe81 Matthias Blankertz 2020-04-17  707  	if (rsnd_ssi_is_parent(mod, io))
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  708  		return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  709  
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  710  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  711  		return 0;
fd9adcfdc1434f Kuninori Morimoto  2016-02-18  712  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  713  	if (enable)
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  714  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  715  
391d452251464b Yongbo Zhang       2020-05-08  716  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  717  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  718  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  719  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  720  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  721  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  722  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  723  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  724  			val |= 0xff00;
391d452251464b Yongbo Zhang       2020-05-08  725  			break;
391d452251464b Yongbo Zhang       2020-05-08  726  		}
391d452251464b Yongbo Zhang       2020-05-08  727  	}
391d452251464b Yongbo Zhang       2020-05-08  728  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  729  	rsnd_mod_write(mod, SSI_INT_ENABLE, val);
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  730  
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  731  	return 0;
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  732  }
615fb6c7b13b7f Kuninori Morimoto  2016-02-18  733  
d8d9b9730cd62c Kuninori Morimoto  2017-12-11 @734  static bool rsnd_ssi_pio_interrupt(struct rsnd_mod *mod,
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  735  				   struct rsnd_dai_stream *io);
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  736  static void __rsnd_ssi_interrupt(struct rsnd_mod *mod,
bfc0cfe6b7acb1 Kuninori Morimoto  2015-06-15  737  				 struct rsnd_dai_stream *io)
ae5c322303fff5 Kuninori Morimoto  2013-07-21  738  {
690602fcd85385 Kuninori Morimoto  2015-01-15  739  	struct rsnd_priv *priv = rsnd_mod_to_priv(mod);
2b62786951ca38 Kuninori Morimoto  2018-02-13  740  	struct device *dev = rsnd_priv_to_dev(priv);
765ae7c8dda7d0 Kuninori Morimoto  2015-01-15  741  	int is_dma = rsnd_ssi_is_dma_mode(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  742  	u32 status;
75defee0f1b3fc Kuninori Morimoto  2015-06-15  743  	bool elapsed = false;
6a25c8da00284f Kuninori Morimoto  2016-01-26  744  	bool stop = false;
391d452251464b Yongbo Zhang       2020-05-08  745  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang       2020-05-08  746  
391d452251464b Yongbo Zhang       2020-05-08  747  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang       2020-05-08  748  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
02299d9875bab5 Kuninori Morimoto  2015-05-21  749  
02299d9875bab5 Kuninori Morimoto  2015-05-21  750  	spin_lock(&priv->lock);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  751  
02299d9875bab5 Kuninori Morimoto  2015-05-21  752  	/* ignore all cases if not working */
d5bbe7de563ccc Kuninori Morimoto  2015-06-15  753  	if (!rsnd_io_is_working(io))
02299d9875bab5 Kuninori Morimoto  2015-05-21  754  		goto rsnd_ssi_interrupt_out;
02299d9875bab5 Kuninori Morimoto  2015-05-21  755  
6a25c8da00284f Kuninori Morimoto  2016-01-26  756  	status = rsnd_ssi_status_get(mod);
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  757  
4e7d606cd52aa8 Kuninori Morimoto  2014-11-27  758  	/* PIO only */
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  759  	if (!is_dma && (status & DIRQ))
d8d9b9730cd62c Kuninori Morimoto  2017-12-11  760  		elapsed = rsnd_ssi_pio_interrupt(mod, io);
ae5c322303fff5 Kuninori Morimoto  2013-07-21  761  
12927a8f802642 Kuninori Morimoto  2015-06-15  762  	/* DMA only */
2b62786951ca38 Kuninori Morimoto  2018-02-13  763  	if (is_dma && (status & (UIRQ | OIRQ))) {
c0ea089dbad47a Kuninori Morimoto  2018-10-30  764  		rsnd_dbg_irq_status(dev, "%s err status : 0x%08x\n",
c0ea089dbad47a Kuninori Morimoto  2018-10-30  765  			rsnd_mod_name(mod), status);
2b62786951ca38 Kuninori Morimoto  2018-02-13  766  
6a25c8da00284f Kuninori Morimoto  2016-01-26  767  		stop = true;
2b62786951ca38 Kuninori Morimoto  2018-02-13  768  	}
69e32a58bde674 Kuninori Morimoto  2015-10-26  769  
391d452251464b Yongbo Zhang       2020-05-08  770  	status = 0;
391d452251464b Yongbo Zhang       2020-05-08  771  
391d452251464b Yongbo Zhang       2020-05-08  772  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang       2020-05-08  773  		switch (id) {
391d452251464b Yongbo Zhang       2020-05-08  774  		case 0:
391d452251464b Yongbo Zhang       2020-05-08  775  		case 1:
391d452251464b Yongbo Zhang       2020-05-08  776  		case 2:
391d452251464b Yongbo Zhang       2020-05-08  777  		case 3:
391d452251464b Yongbo Zhang       2020-05-08  778  		case 4:
391d452251464b Yongbo Zhang       2020-05-08  779  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  780  				status = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang       2020-05-08  781  						       SSI_SYS_STATUS(i * 2));
391d452251464b Yongbo Zhang       2020-05-08  782  				status &= 0xf << (id * 4);
391d452251464b Yongbo Zhang       2020-05-08  783  
391d452251464b Yongbo Zhang       2020-05-08  784  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  785  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  786  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  787  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  788  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  789  						       SSI_SYS_STATUS(i * 2),
391d452251464b Yongbo Zhang       2020-05-08  790  						       0xf << (id * 4));
391d452251464b Yongbo Zhang       2020-05-08  791  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  792  					break;
391d452251464b Yongbo Zhang       2020-05-08  793  				}
391d452251464b Yongbo Zhang       2020-05-08  794  			}
391d452251464b Yongbo Zhang       2020-05-08  795  			break;
391d452251464b Yongbo Zhang       2020-05-08  796  		case 9:
391d452251464b Yongbo Zhang       2020-05-08  797  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang       2020-05-08  798  				status = rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  799  						SSI_SYS_STATUS((i * 2) + 1));
391d452251464b Yongbo Zhang       2020-05-08  800  				status &= 0xf << 4;
391d452251464b Yongbo Zhang       2020-05-08  801  
391d452251464b Yongbo Zhang       2020-05-08  802  				if (status) {
391d452251464b Yongbo Zhang       2020-05-08  803  					rsnd_dbg_irq_status(dev,
391d452251464b Yongbo Zhang       2020-05-08  804  						"%s err status : 0x%08x\n",
391d452251464b Yongbo Zhang       2020-05-08  805  						rsnd_mod_name(mod), status);
391d452251464b Yongbo Zhang       2020-05-08  806  					rsnd_mod_write(mod,
391d452251464b Yongbo Zhang       2020-05-08  807  						SSI_SYS_STATUS((i * 2) + 1),
391d452251464b Yongbo Zhang       2020-05-08  808  						0xf << 4);
391d452251464b Yongbo Zhang       2020-05-08  809  					stop = true;
391d452251464b Yongbo Zhang       2020-05-08  810  					break;
391d452251464b Yongbo Zhang       2020-05-08  811  				}
391d452251464b Yongbo Zhang       2020-05-08  812  			}
391d452251464b Yongbo Zhang       2020-05-08  813  			break;
391d452251464b Yongbo Zhang       2020-05-08  814  		}
391d452251464b Yongbo Zhang       2020-05-08  815  	}
391d452251464b Yongbo Zhang       2020-05-08  816  
5342dff2326393 Kuninori Morimoto  2015-11-26  817  	rsnd_ssi_status_clear(mod);
02299d9875bab5 Kuninori Morimoto  2015-05-21  818  rsnd_ssi_interrupt_out:
02299d9875bab5 Kuninori Morimoto  2015-05-21  819  	spin_unlock(&priv->lock);
02299d9875bab5 Kuninori Morimoto  2015-05-21  820  
75defee0f1b3fc Kuninori Morimoto  2015-06-15  821  	if (elapsed)
75defee0f1b3fc Kuninori Morimoto  2015-06-15  822  		rsnd_dai_period_elapsed(io);
6a25c8da00284f Kuninori Morimoto  2016-01-26  823  
6a25c8da00284f Kuninori Morimoto  2016-01-26  824  	if (stop)
6a25c8da00284f Kuninori Morimoto  2016-01-26  825  		snd_pcm_stop_xrun(io->substream);
6a25c8da00284f Kuninori Morimoto  2016-01-26  826  

:::::: The code at line 596 was first introduced by commit
:::::: 919567d914b3c134e60c01db72a03a0adc5f41b9 ASoC: rsnd: make sure SSI parent/child uses same number of sound channel.

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 62814 bytes --]

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
  2020-05-08  7:47 ` Yongbo Zhang
@ 2020-05-11  1:30   ` Kuninori Morimoto
  -1 siblings, 0 replies; 14+ messages in thread
From: Kuninori Morimoto @ 2020-05-11  1:30 UTC (permalink / raw)
  To: Yongbo Zhang
  Cc: broonie, lgirdwood, alsa-devel, linux-renesas-soc, linux-kernel, Chen Li


Hi Yongbo

Thank you for the patch

> SSI BUSIF buffer is possible to overflow or underflow, especially in a
> hypervisor environment. If there is no interrupt support, it will eventually
> lead to errors in pcm data.
> This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
> 
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Reported-by: Chen Li <licheng0822@thundersoft.com>
> Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
> Tested-by: Chen Li <licheng0822@thundersoft.com>
> ---
(snip)
> @@ -635,6 +713,19 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
>  	if (enable)
>  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
>  
> +	if (is_tdm || is_tdm_split) {
> +		switch (id) {
> +		case 0:
> +		case 1:
> +		case 2:
> +		case 3:
> +		case 4:
> +		case 9:
> +			val |= 0xff00;
> +			break;
> +		}
> +	}

This is small things, but we like to have
	- val |= 0xff00;
	+ val |= 0x0000ff00;

Except above

	Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-11  1:30   ` Kuninori Morimoto
  0 siblings, 0 replies; 14+ messages in thread
From: Kuninori Morimoto @ 2020-05-11  1:30 UTC (permalink / raw)
  To: Yongbo Zhang
  Cc: Chen Li, alsa-devel, lgirdwood, linux-kernel, linux-renesas-soc, broonie


Hi Yongbo

Thank you for the patch

> SSI BUSIF buffer is possible to overflow or underflow, especially in a
> hypervisor environment. If there is no interrupt support, it will eventually
> lead to errors in pcm data.
> This patch adds overflow and underflow interrupt support for SSI BUSIF buffer.
> 
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Reported-by: Chen Li <licheng0822@thundersoft.com>
> Signed-off-by: Yongbo Zhang <giraffesnn123@gmail.com>
> Tested-by: Chen Li <licheng0822@thundersoft.com>
> ---
(snip)
> @@ -635,6 +713,19 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,
>  	if (enable)
>  		val = rsnd_ssi_is_dma_mode(mod) ? 0x0e000000 : 0x0f000000;
>  
> +	if (is_tdm || is_tdm_split) {
> +		switch (id) {
> +		case 0:
> +		case 1:
> +		case 2:
> +		case 3:
> +		case 4:
> +		case 9:
> +			val |= 0xff00;
> +			break;
> +		}
> +	}

This is small things, but we like to have
	- val |= 0xff00;
	+ val |= 0x0000ff00;

Except above

	Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
  2020-05-08  7:47 ` Yongbo Zhang
  (?)
@ 2020-05-12  6:39   ` kbuild test robot
  -1 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-12  6:39 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: kbuild-all, alsa-devel, linux-renesas-soc, linux-kernel,
	Yongbo Zhang, Kuninori Morimoto

Hi Yongbo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: ''. [syntaxError]
   {
   ^
>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: 'DEBUG'. [syntaxError]
   {
   ^

# https://github.com/0day-ci/linux/commit/391d452251464b78f72ba3a1fd9b6091b3d4a942
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 391d452251464b78f72ba3a1fd9b6091b3d4a942
vim +531 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto 2013-07-21  527  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  528  static int rsnd_ssi_quit(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15  529  			 struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto 2015-01-15  530  			 struct rsnd_priv *priv)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 @531  {
ae5c322303fff5 Kuninori Morimoto 2013-07-21  532  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  533  	struct device *dev = rsnd_priv_to_dev(priv);
391d452251464b Yongbo Zhang      2020-05-08  534  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang      2020-05-08  535  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang      2020-05-08  536  	int i;
391d452251464b Yongbo Zhang      2020-05-08  537  	u32 sys_int_enable = 0;
391d452251464b Yongbo Zhang      2020-05-08  538  
391d452251464b Yongbo Zhang      2020-05-08  539  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang      2020-05-08  540  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  541  
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  542  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  543  		return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  544  
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  545  	if (!ssi->usrcnt) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30  546  		dev_err(dev, "%s usrcnt error\n", rsnd_mod_name(mod));
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  547  		return -EIO;
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  548  	}
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  549  
26d34b11af6a34 Kuninori Morimoto 2016-02-18  550  	rsnd_ssi_master_clk_stop(mod, io);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  551  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  552  	rsnd_mod_power_off(mod);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  553  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  554  	ssi->usrcnt--;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  555  
203cdf51f28820 Kuninori Morimoto 2018-06-12  556  	if (!ssi->usrcnt) {
203cdf51f28820 Kuninori Morimoto 2018-06-12  557  		ssi->cr_own	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  558  		ssi->cr_mode	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  559  		ssi->wsr	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  560  	}
203cdf51f28820 Kuninori Morimoto 2018-06-12  561  
391d452251464b Yongbo Zhang      2020-05-08  562  	/* disable busif buffer over/under run interrupt. */
391d452251464b Yongbo Zhang      2020-05-08  563  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang      2020-05-08  564  		switch (id) {
391d452251464b Yongbo Zhang      2020-05-08  565  		case 0:
391d452251464b Yongbo Zhang      2020-05-08  566  		case 1:
391d452251464b Yongbo Zhang      2020-05-08  567  		case 2:
391d452251464b Yongbo Zhang      2020-05-08  568  		case 3:
391d452251464b Yongbo Zhang      2020-05-08  569  		case 4:
391d452251464b Yongbo Zhang      2020-05-08  570  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  571  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  572  						SSI_SYS_INT_ENABLE(i * 2));
391d452251464b Yongbo Zhang      2020-05-08  573  				sys_int_enable &= ~(0xf << (id * 4));
391d452251464b Yongbo Zhang      2020-05-08  574  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  575  					       SSI_SYS_INT_ENABLE(i * 2),
391d452251464b Yongbo Zhang      2020-05-08  576  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  577  			}
391d452251464b Yongbo Zhang      2020-05-08  578  
391d452251464b Yongbo Zhang      2020-05-08  579  			break;
391d452251464b Yongbo Zhang      2020-05-08  580  		case 9:
391d452251464b Yongbo Zhang      2020-05-08  581  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  582  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  583  					SSI_SYS_INT_ENABLE((i * 2) + 1));
391d452251464b Yongbo Zhang      2020-05-08  584  				sys_int_enable &= ~(0xf << 4);
391d452251464b Yongbo Zhang      2020-05-08  585  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  586  					       SSI_SYS_INT_ENABLE((i * 2) + 1),
391d452251464b Yongbo Zhang      2020-05-08  587  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  588  			}
391d452251464b Yongbo Zhang      2020-05-08  589  
391d452251464b Yongbo Zhang      2020-05-08  590  			break;
391d452251464b Yongbo Zhang      2020-05-08  591  		}
391d452251464b Yongbo Zhang      2020-05-08  592  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  593  	return 0;
ae5c322303fff5 Kuninori Morimoto 2013-07-21  594  }
ae5c322303fff5 Kuninori Morimoto 2013-07-21  595  

:::::: The code at line 531 was first introduced by commit
:::::: ae5c322303fff50b93d60e34c6563f1264a5941b ASoC: add Renesas R-Car SSI feature

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-12  6:39   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-12  6:39 UTC (permalink / raw)
  To: Yongbo Zhang, broonie, lgirdwood, alsa-devel, linux-renesas-soc,
	linux-kernel, Kuninori Morimoto, Chen Li
  Cc: alsa-devel, kbuild-all, Kuninori Morimoto, linux-kernel,
	linux-renesas-soc, Yongbo Zhang

Hi Yongbo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: ''. [syntaxError]
   {
   ^
>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: 'DEBUG'. [syntaxError]
   {
   ^

# https://github.com/0day-ci/linux/commit/391d452251464b78f72ba3a1fd9b6091b3d4a942
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 391d452251464b78f72ba3a1fd9b6091b3d4a942
vim +531 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto 2013-07-21  527  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  528  static int rsnd_ssi_quit(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15  529  			 struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto 2015-01-15  530  			 struct rsnd_priv *priv)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 @531  {
ae5c322303fff5 Kuninori Morimoto 2013-07-21  532  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  533  	struct device *dev = rsnd_priv_to_dev(priv);
391d452251464b Yongbo Zhang      2020-05-08  534  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang      2020-05-08  535  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang      2020-05-08  536  	int i;
391d452251464b Yongbo Zhang      2020-05-08  537  	u32 sys_int_enable = 0;
391d452251464b Yongbo Zhang      2020-05-08  538  
391d452251464b Yongbo Zhang      2020-05-08  539  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang      2020-05-08  540  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  541  
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  542  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  543  		return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  544  
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  545  	if (!ssi->usrcnt) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30  546  		dev_err(dev, "%s usrcnt error\n", rsnd_mod_name(mod));
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  547  		return -EIO;
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  548  	}
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  549  
26d34b11af6a34 Kuninori Morimoto 2016-02-18  550  	rsnd_ssi_master_clk_stop(mod, io);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  551  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  552  	rsnd_mod_power_off(mod);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  553  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  554  	ssi->usrcnt--;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  555  
203cdf51f28820 Kuninori Morimoto 2018-06-12  556  	if (!ssi->usrcnt) {
203cdf51f28820 Kuninori Morimoto 2018-06-12  557  		ssi->cr_own	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  558  		ssi->cr_mode	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  559  		ssi->wsr	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  560  	}
203cdf51f28820 Kuninori Morimoto 2018-06-12  561  
391d452251464b Yongbo Zhang      2020-05-08  562  	/* disable busif buffer over/under run interrupt. */
391d452251464b Yongbo Zhang      2020-05-08  563  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang      2020-05-08  564  		switch (id) {
391d452251464b Yongbo Zhang      2020-05-08  565  		case 0:
391d452251464b Yongbo Zhang      2020-05-08  566  		case 1:
391d452251464b Yongbo Zhang      2020-05-08  567  		case 2:
391d452251464b Yongbo Zhang      2020-05-08  568  		case 3:
391d452251464b Yongbo Zhang      2020-05-08  569  		case 4:
391d452251464b Yongbo Zhang      2020-05-08  570  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  571  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  572  						SSI_SYS_INT_ENABLE(i * 2));
391d452251464b Yongbo Zhang      2020-05-08  573  				sys_int_enable &= ~(0xf << (id * 4));
391d452251464b Yongbo Zhang      2020-05-08  574  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  575  					       SSI_SYS_INT_ENABLE(i * 2),
391d452251464b Yongbo Zhang      2020-05-08  576  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  577  			}
391d452251464b Yongbo Zhang      2020-05-08  578  
391d452251464b Yongbo Zhang      2020-05-08  579  			break;
391d452251464b Yongbo Zhang      2020-05-08  580  		case 9:
391d452251464b Yongbo Zhang      2020-05-08  581  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  582  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  583  					SSI_SYS_INT_ENABLE((i * 2) + 1));
391d452251464b Yongbo Zhang      2020-05-08  584  				sys_int_enable &= ~(0xf << 4);
391d452251464b Yongbo Zhang      2020-05-08  585  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  586  					       SSI_SYS_INT_ENABLE((i * 2) + 1),
391d452251464b Yongbo Zhang      2020-05-08  587  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  588  			}
391d452251464b Yongbo Zhang      2020-05-08  589  
391d452251464b Yongbo Zhang      2020-05-08  590  			break;
391d452251464b Yongbo Zhang      2020-05-08  591  		}
391d452251464b Yongbo Zhang      2020-05-08  592  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  593  	return 0;
ae5c322303fff5 Kuninori Morimoto 2013-07-21  594  }
ae5c322303fff5 Kuninori Morimoto 2013-07-21  595  

:::::: The code at line 531 was first introduced by commit
:::::: ae5c322303fff50b93d60e34c6563f1264a5941b ASoC: add Renesas R-Car SSI feature

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org


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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-12  6:39   ` kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-12  6:39 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6610 bytes --]

Hi Yongbo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: ''. [syntaxError]
   {
   ^
>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: 'DEBUG'. [syntaxError]
   {
   ^

# https://github.com/0day-ci/linux/commit/391d452251464b78f72ba3a1fd9b6091b3d4a942
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 391d452251464b78f72ba3a1fd9b6091b3d4a942
vim +531 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto 2013-07-21  527  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  528  static int rsnd_ssi_quit(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15  529  			 struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto 2015-01-15  530  			 struct rsnd_priv *priv)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 @531  {
ae5c322303fff5 Kuninori Morimoto 2013-07-21  532  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  533  	struct device *dev = rsnd_priv_to_dev(priv);
391d452251464b Yongbo Zhang      2020-05-08  534  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang      2020-05-08  535  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang      2020-05-08  536  	int i;
391d452251464b Yongbo Zhang      2020-05-08  537  	u32 sys_int_enable = 0;
391d452251464b Yongbo Zhang      2020-05-08  538  
391d452251464b Yongbo Zhang      2020-05-08  539  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang      2020-05-08  540  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  541  
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  542  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  543  		return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  544  
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  545  	if (!ssi->usrcnt) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30  546  		dev_err(dev, "%s usrcnt error\n", rsnd_mod_name(mod));
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  547  		return -EIO;
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  548  	}
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  549  
26d34b11af6a34 Kuninori Morimoto 2016-02-18  550  	rsnd_ssi_master_clk_stop(mod, io);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  551  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  552  	rsnd_mod_power_off(mod);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  553  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  554  	ssi->usrcnt--;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  555  
203cdf51f28820 Kuninori Morimoto 2018-06-12  556  	if (!ssi->usrcnt) {
203cdf51f28820 Kuninori Morimoto 2018-06-12  557  		ssi->cr_own	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  558  		ssi->cr_mode	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  559  		ssi->wsr	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  560  	}
203cdf51f28820 Kuninori Morimoto 2018-06-12  561  
391d452251464b Yongbo Zhang      2020-05-08  562  	/* disable busif buffer over/under run interrupt. */
391d452251464b Yongbo Zhang      2020-05-08  563  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang      2020-05-08  564  		switch (id) {
391d452251464b Yongbo Zhang      2020-05-08  565  		case 0:
391d452251464b Yongbo Zhang      2020-05-08  566  		case 1:
391d452251464b Yongbo Zhang      2020-05-08  567  		case 2:
391d452251464b Yongbo Zhang      2020-05-08  568  		case 3:
391d452251464b Yongbo Zhang      2020-05-08  569  		case 4:
391d452251464b Yongbo Zhang      2020-05-08  570  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  571  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  572  						SSI_SYS_INT_ENABLE(i * 2));
391d452251464b Yongbo Zhang      2020-05-08  573  				sys_int_enable &= ~(0xf << (id * 4));
391d452251464b Yongbo Zhang      2020-05-08  574  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  575  					       SSI_SYS_INT_ENABLE(i * 2),
391d452251464b Yongbo Zhang      2020-05-08  576  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  577  			}
391d452251464b Yongbo Zhang      2020-05-08  578  
391d452251464b Yongbo Zhang      2020-05-08  579  			break;
391d452251464b Yongbo Zhang      2020-05-08  580  		case 9:
391d452251464b Yongbo Zhang      2020-05-08  581  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  582  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  583  					SSI_SYS_INT_ENABLE((i * 2) + 1));
391d452251464b Yongbo Zhang      2020-05-08  584  				sys_int_enable &= ~(0xf << 4);
391d452251464b Yongbo Zhang      2020-05-08  585  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  586  					       SSI_SYS_INT_ENABLE((i * 2) + 1),
391d452251464b Yongbo Zhang      2020-05-08  587  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  588  			}
391d452251464b Yongbo Zhang      2020-05-08  589  
391d452251464b Yongbo Zhang      2020-05-08  590  			break;
391d452251464b Yongbo Zhang      2020-05-08  591  		}
391d452251464b Yongbo Zhang      2020-05-08  592  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  593  	return 0;
ae5c322303fff5 Kuninori Morimoto 2013-07-21  594  }
ae5c322303fff5 Kuninori Morimoto 2013-07-21  595  

:::::: The code@line 531 was first introduced by commit
:::::: ae5c322303fff50b93d60e34c6563f1264a5941b ASoC: add Renesas R-Car SSI feature

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

* Re: [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer
@ 2020-05-09  2:23 kbuild test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kbuild test robot @ 2020-05-09  2:23 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 7591 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200508074753.10362-1-giraffesnn123@gmail.com>
References: <20200508074753.10362-1-giraffesnn123@gmail.com>
TO: Yongbo Zhang <giraffesnn123@gmail.com>
TO: broonie(a)kernel.org
TO: lgirdwood(a)gmail.com
TO: alsa-devel(a)alsa-project.org
TO: linux-renesas-soc(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
TO: Yongbo Zhang <giraffesnn123@gmail.com>
TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
TO: Chen Li <licheng0822@thundersoft.com>
TO: alsa-devel(a)alsa-project.org
TO: linux-renesas-soc(a)vger.kernel.org
TO: linux-kernel(a)vger.kernel.org
TO: Yongbo Zhang <giraffesnn123@gmail.com>
TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
TO: Chen Li <licheng0822@thundersoft.com>
CC: alsa-devel(a)alsa-project.org
CC: linux-renesas-soc(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Yongbo Zhang <giraffesnn123@gmail.com>
CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Hi Yongbo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on asoc/for-next]
[also build test WARNING on v5.7-rc4 next-20200508]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yongbo-Zhang/ASoC-rsnd-add-interrupt-support-for-SSI-BUSIF-buffer/20200509-035713
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
:::::: branch date: 6 hours ago
:::::: commit date: 6 hours ago

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>


cppcheck warnings: (new ones prefixed by >>)

>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: ''. [syntaxError]
   {
   ^
>> sound/soc/sh/rcar/ssi.c:531:1: warning: Unmatched '{'. Configuration: 'DEBUG'. [syntaxError]
   {
   ^

# https://github.com/0day-ci/linux/commit/391d452251464b78f72ba3a1fd9b6091b3d4a942
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 391d452251464b78f72ba3a1fd9b6091b3d4a942
vim +531 sound/soc/sh/rcar/ssi.c

ae5c322303fff5 Kuninori Morimoto 2013-07-21  527  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  528  static int rsnd_ssi_quit(struct rsnd_mod *mod,
2c0fac19de2cd7 Kuninori Morimoto 2015-06-15  529  			 struct rsnd_dai_stream *io,
690602fcd85385 Kuninori Morimoto 2015-01-15  530  			 struct rsnd_priv *priv)
ae5c322303fff5 Kuninori Morimoto 2013-07-21 @531  {
ae5c322303fff5 Kuninori Morimoto 2013-07-21  532  	struct rsnd_ssi *ssi = rsnd_mod_to_ssi(mod);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  533  	struct device *dev = rsnd_priv_to_dev(priv);
391d452251464b Yongbo Zhang      2020-05-08  534  	int is_tdm, is_tdm_split;
391d452251464b Yongbo Zhang      2020-05-08  535  	int id = rsnd_mod_id(mod);
391d452251464b Yongbo Zhang      2020-05-08  536  	int i;
391d452251464b Yongbo Zhang      2020-05-08  537  	u32 sys_int_enable = 0;
391d452251464b Yongbo Zhang      2020-05-08  538  
391d452251464b Yongbo Zhang      2020-05-08  539  	is_tdm		= rsnd_runtime_is_tdm(io);
391d452251464b Yongbo Zhang      2020-05-08  540  	is_tdm_split	= rsnd_runtime_is_tdm_split(io);
ae5c322303fff5 Kuninori Morimoto 2013-07-21  541  
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  542  	if (!rsnd_ssi_is_run_mods(mod, io))
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  543  		return 0;
fd9adcfdc1434f Kuninori Morimoto 2016-02-18  544  
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  545  	if (!ssi->usrcnt) {
c0ea089dbad47a Kuninori Morimoto 2018-10-30  546  		dev_err(dev, "%s usrcnt error\n", rsnd_mod_name(mod));
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  547  		return -EIO;
e5d9cfc6f5fe56 Andrzej Hajda     2015-12-24  548  	}
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  549  
26d34b11af6a34 Kuninori Morimoto 2016-02-18  550  	rsnd_ssi_master_clk_stop(mod, io);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  551  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  552  	rsnd_mod_power_off(mod);
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  553  
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  554  	ssi->usrcnt--;
e7d850dd10f4e6 Kuninori Morimoto 2015-10-26  555  
203cdf51f28820 Kuninori Morimoto 2018-06-12  556  	if (!ssi->usrcnt) {
203cdf51f28820 Kuninori Morimoto 2018-06-12  557  		ssi->cr_own	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  558  		ssi->cr_mode	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  559  		ssi->wsr	= 0;
203cdf51f28820 Kuninori Morimoto 2018-06-12  560  	}
203cdf51f28820 Kuninori Morimoto 2018-06-12  561  
391d452251464b Yongbo Zhang      2020-05-08  562  	/* disable busif buffer over/under run interrupt. */
391d452251464b Yongbo Zhang      2020-05-08  563  	if (is_tdm || is_tdm_split) {
391d452251464b Yongbo Zhang      2020-05-08  564  		switch (id) {
391d452251464b Yongbo Zhang      2020-05-08  565  		case 0:
391d452251464b Yongbo Zhang      2020-05-08  566  		case 1:
391d452251464b Yongbo Zhang      2020-05-08  567  		case 2:
391d452251464b Yongbo Zhang      2020-05-08  568  		case 3:
391d452251464b Yongbo Zhang      2020-05-08  569  		case 4:
391d452251464b Yongbo Zhang      2020-05-08  570  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  571  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  572  						SSI_SYS_INT_ENABLE(i * 2));
391d452251464b Yongbo Zhang      2020-05-08  573  				sys_int_enable &= ~(0xf << (id * 4));
391d452251464b Yongbo Zhang      2020-05-08  574  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  575  					       SSI_SYS_INT_ENABLE(i * 2),
391d452251464b Yongbo Zhang      2020-05-08  576  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  577  			}
391d452251464b Yongbo Zhang      2020-05-08  578  
391d452251464b Yongbo Zhang      2020-05-08  579  			break;
391d452251464b Yongbo Zhang      2020-05-08  580  		case 9:
391d452251464b Yongbo Zhang      2020-05-08  581  			for (i = 0; i < 4; i++) {
391d452251464b Yongbo Zhang      2020-05-08  582  				sys_int_enable = rsnd_mod_read(mod,
391d452251464b Yongbo Zhang      2020-05-08  583  					SSI_SYS_INT_ENABLE((i * 2) + 1));
391d452251464b Yongbo Zhang      2020-05-08  584  				sys_int_enable &= ~(0xf << 4);
391d452251464b Yongbo Zhang      2020-05-08  585  				rsnd_mod_write(mod,
391d452251464b Yongbo Zhang      2020-05-08  586  					       SSI_SYS_INT_ENABLE((i * 2) + 1),
391d452251464b Yongbo Zhang      2020-05-08  587  					       sys_int_enable);
391d452251464b Yongbo Zhang      2020-05-08  588  			}
391d452251464b Yongbo Zhang      2020-05-08  589  
391d452251464b Yongbo Zhang      2020-05-08  590  			break;
391d452251464b Yongbo Zhang      2020-05-08  591  		}
391d452251464b Yongbo Zhang      2020-05-08  592  
ae5c322303fff5 Kuninori Morimoto 2013-07-21  593  	return 0;
ae5c322303fff5 Kuninori Morimoto 2013-07-21  594  }
ae5c322303fff5 Kuninori Morimoto 2013-07-21  595  

:::::: The code@line 531 was first introduced by commit
:::::: ae5c322303fff50b93d60e34c6563f1264a5941b ASoC: add Renesas R-Car SSI feature

:::::: TO: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
:::::: CC: Mark Brown <broonie@linaro.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

end of thread, other threads:[~2020-05-12  6:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  7:47 [PATCH] ASoC: rsnd: add interrupt support for SSI BUSIF buffer Yongbo Zhang
2020-05-08  7:47 ` Yongbo Zhang
2020-05-08 23:56 ` kbuild test robot
2020-05-08 23:56   ` kbuild test robot
2020-05-08 23:56   ` kbuild test robot
2020-05-09 11:07 ` kbuild test robot
2020-05-09 11:07   ` kbuild test robot
2020-05-09 11:07   ` kbuild test robot
2020-05-11  1:30 ` Kuninori Morimoto
2020-05-11  1:30   ` Kuninori Morimoto
2020-05-12  6:39 ` kbuild test robot
2020-05-12  6:39   ` kbuild test robot
2020-05-12  6:39   ` kbuild test robot
2020-05-09  2:23 kbuild test robot

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.