[alsa-devel] ASoC: rsnd: status debug message and its suppress
Hi Mark
Renesas sound driver want to know status when debugging, but sometimes it is too much information. These patches indicate status information when debugging, but we can suppress it by special define
Kuninori Morimoto (2): ASoC: rsnd: indicate IRQ error status for debug ASoC: rsnd: suppress rsnd_dai_call() debug message
sound/soc/sh/rcar/core.c | 11 ++++++++++- sound/soc/sh/rcar/rsnd.h | 20 ++++++++++++++++++++ sound/soc/sh/rcar/src.c | 22 ++++++++++++++++++++-- sound/soc/sh/rcar/ssi.c | 16 +++++++++++++++- 4 files changed, 65 insertions(+), 4 deletions(-)
Best regards --- Kuninori Morimoto
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
SSI/SRC have under/over flow error handling, and its status is useful for debuging. But sometimes it might be too much message, and it might blocks necessity other information.
To avoid such situation, basically this patch indicates interrupt status debug message if DEBUG was defined, but it will be suppressed if RSND_DEBUG_NO_IRQ_STATUS was defined.
Reported-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com --- sound/soc/sh/rcar/rsnd.h | 10 ++++++++++ sound/soc/sh/rcar/src.c | 22 ++++++++++++++++++++-- sound/soc/sh/rcar/ssi.c | 16 +++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ad65235..5241ea7 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -788,4 +788,14 @@ unsigned int rsnd_src_get_rate(struct rsnd_priv *priv, #define rsnd_mod_confirm_dvc(mdvc) #endif
+/* + * If you don't need interrupt status debug message, + * define RSND_DEBUG_NO_IRQ_STATUS as 1 on top of src.c/ssi.c + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ +#define rsnd_dbg_irq_status(dev, param...) \ + if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \ + dev_dbg(dev, param) + #endif diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 510b68a..a727e715 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -8,6 +8,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include "rsnd.h"
#define SRC_NAME "src" @@ -325,7 +334,10 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod)
static bool rsnd_src_error_occurred(struct rsnd_mod *mod) { + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); u32 val0, val1; + u32 status0, status1; bool ret = false;
val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); @@ -338,9 +350,15 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod) if (rsnd_src_sync_is_enabled(mod)) val0 = val0 & 0xffff;
- if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || - (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) + status0 = rsnd_mod_read(mod, SCU_SYS_STATUS0); + status1 = rsnd_mod_read(mod, SCU_SYS_STATUS1); + if ((status0 & val0) || (status1 & val1)) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x, 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), + status0, status1); + ret = true; + }
return ret; } diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 97a9db8..333b802 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -11,6 +11,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include <sound/simple_card_utils.h> #include <linux/delay.h> #include "rsnd.h" @@ -603,6 +612,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); int is_dma = rsnd_ssi_is_dma_mode(mod); u32 status; bool elapsed = false; @@ -621,8 +631,12 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, elapsed = rsnd_ssi_pio_interrupt(mod, io);
/* DMA only */ - if (is_dma && (status & (UIRQ | OIRQ))) + if (is_dma && (status & (UIRQ | OIRQ))) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), status); + stop = true; + }
rsnd_ssi_status_clear(mod); rsnd_ssi_interrupt_out:
The patch
ASoC: rsnd: indicate IRQ error status for debug
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 2b62786951ca38cc9fd0bd9273de0aae1b45134d Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 13 Feb 2018 02:08:53 +0000 Subject: [PATCH] ASoC: rsnd: indicate IRQ error status for debug
SSI/SRC have under/over flow error handling, and its status is useful for debuging. But sometimes it might be too much message, and it might blocks necessity other information.
To avoid such situation, basically this patch indicates interrupt status debug message if DEBUG was defined, but it will be suppressed if RSND_DEBUG_NO_IRQ_STATUS was defined.
Reported-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sh/rcar/rsnd.h | 10 ++++++++++ sound/soc/sh/rcar/src.c | 22 ++++++++++++++++++++-- sound/soc/sh/rcar/ssi.c | 16 +++++++++++++++- 3 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index ad6523595b0a..5241ea7cf153 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -788,4 +788,14 @@ void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type); #define rsnd_mod_confirm_dvc(mdvc) #endif
+/* + * If you don't need interrupt status debug message, + * define RSND_DEBUG_NO_IRQ_STATUS as 1 on top of src.c/ssi.c + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ +#define rsnd_dbg_irq_status(dev, param...) \ + if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \ + dev_dbg(dev, param) + #endif diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 510b68a483b4..a727e71587b6 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c @@ -8,6 +8,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include "rsnd.h"
#define SRC_NAME "src" @@ -325,7 +334,10 @@ static void rsnd_src_status_clear(struct rsnd_mod *mod)
static bool rsnd_src_error_occurred(struct rsnd_mod *mod) { + struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); u32 val0, val1; + u32 status0, status1; bool ret = false;
val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); @@ -338,9 +350,15 @@ static bool rsnd_src_error_occurred(struct rsnd_mod *mod) if (rsnd_src_sync_is_enabled(mod)) val0 = val0 & 0xffff;
- if ((rsnd_mod_read(mod, SCU_SYS_STATUS0) & val0) || - (rsnd_mod_read(mod, SCU_SYS_STATUS1) & val1)) + status0 = rsnd_mod_read(mod, SCU_SYS_STATUS0); + status1 = rsnd_mod_read(mod, SCU_SYS_STATUS1); + if ((status0 & val0) || (status1 & val1)) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x, 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), + status0, status1); + ret = true; + }
return ret; } diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 97a9db892a8f..333b802681ad 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c @@ -11,6 +11,15 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ + +/* + * you can enable below define if you don't need + * SSI interrupt status debug message when debugging + * see rsnd_dbg_irq_status() + * + * #define RSND_DEBUG_NO_IRQ_STATUS 1 + */ + #include <sound/simple_card_utils.h> #include <linux/delay.h> #include "rsnd.h" @@ -603,6 +612,7 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, struct rsnd_dai_stream *io) { struct rsnd_priv *priv = rsnd_mod_to_priv(mod); + struct device *dev = rsnd_priv_to_dev(priv); int is_dma = rsnd_ssi_is_dma_mode(mod); u32 status; bool elapsed = false; @@ -621,8 +631,12 @@ static void __rsnd_ssi_interrupt(struct rsnd_mod *mod, elapsed = rsnd_ssi_pio_interrupt(mod, io);
/* DMA only */ - if (is_dma && (status & (UIRQ | OIRQ))) + if (is_dma && (status & (UIRQ | OIRQ))) { + rsnd_dbg_irq_status(dev, "%s[%d] err status : 0x%08x\n", + rsnd_mod_name(mod), rsnd_mod_id(mod), status); + stop = true; + }
rsnd_ssi_status_clear(mod); rsnd_ssi_interrupt_out:
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com
rsnd_dai_call() is using dev_dbg(), but its message is sometimes blocks nessesary other messages. If RSND_DEBUG_NO_DAI_CALL was defined it will be suppressed by this patch.
Reported-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com --- sound/soc/sh/rcar/core.c | 11 ++++++++++- sound/soc/sh/rcar/rsnd.h | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index b400766..b53e915 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -93,6 +93,15 @@ * [mod]->fn() -> [mod]->fn() -> [mod]->fn()... * */ + +/* + * you can enable below define if you don't need + * DAI status debug message when debugging + * see rsnd_dbg_dai_call() + * + * #define RSND_DEBUG_NO_DAI_CALL 1 + */ + #include <linux/pm_runtime.h> #include "rsnd.h"
@@ -468,7 +477,7 @@ static int rsnd_status_update(u32 *status, __rsnd_mod_shift_##fn, \ __rsnd_mod_add_##fn, \ __rsnd_mod_call_##fn); \ - dev_dbg(dev, "%s[%d]\t0x%08x %s\n", \ + rsnd_dbg_dai_call(dev, "%s[%d]\t0x%08x %s\n", \ rsnd_mod_name(mod), rsnd_mod_id(mod), *status, \ (func_call && (mod)->ops->fn) ? #fn : ""); \ if (func_call && (mod)->ops->fn) \ diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 5241ea7..172c8d6 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -798,4 +798,14 @@ unsigned int rsnd_src_get_rate(struct rsnd_priv *priv, if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \ dev_dbg(dev, param)
+/* + * If you don't need rsnd_dai_call debug message, + * define RSND_DEBUG_NO_DAI_CALL as 1 on top of core.c + * + * #define RSND_DEBUG_NO_DAI_CALL 1 + */ +#define rsnd_dbg_dai_call(dev, param...) \ + if (!IS_BUILTIN(RSND_DEBUG_NO_DAI_CALL)) \ + dev_dbg(dev, param) + #endif
The patch
ASoC: rsnd: suppress rsnd_dai_call() debug message
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
From 1f6e920faae065fa8e6985b99ec86899bc3308de Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Date: Tue, 13 Feb 2018 02:09:14 +0000 Subject: [PATCH] ASoC: rsnd: suppress rsnd_dai_call() debug message
rsnd_dai_call() is using dev_dbg(), but its message is sometimes blocks nessesary other messages. If RSND_DEBUG_NO_DAI_CALL was defined it will be suppressed by this patch.
Reported-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Tested-by: Hiroyuki Yokoyama hiroyuki.yokoyama.vx@renesas.com Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/sh/rcar/core.c | 11 ++++++++++- sound/soc/sh/rcar/rsnd.h | 10 ++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 64d5ecb86528..5aafc37f5119 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c @@ -93,6 +93,15 @@ * [mod]->fn() -> [mod]->fn() -> [mod]->fn()... * */ + +/* + * you can enable below define if you don't need + * DAI status debug message when debugging + * see rsnd_dbg_dai_call() + * + * #define RSND_DEBUG_NO_DAI_CALL 1 + */ + #include <linux/pm_runtime.h> #include "rsnd.h"
@@ -468,7 +477,7 @@ static int rsnd_status_update(u32 *status, __rsnd_mod_shift_##fn, \ __rsnd_mod_add_##fn, \ __rsnd_mod_call_##fn); \ - dev_dbg(dev, "%s[%d]\t0x%08x %s\n", \ + rsnd_dbg_dai_call(dev, "%s[%d]\t0x%08x %s\n", \ rsnd_mod_name(mod), rsnd_mod_id(mod), *status, \ (func_call && (mod)->ops->fn) ? #fn : ""); \ if (func_call && (mod)->ops->fn) \ diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 5241ea7cf153..172c8d612890 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h @@ -798,4 +798,14 @@ void rsnd_mod_make_sure(struct rsnd_mod *mod, enum rsnd_mod_type type); if (!IS_BUILTIN(RSND_DEBUG_NO_IRQ_STATUS)) \ dev_dbg(dev, param)
+/* + * If you don't need rsnd_dai_call debug message, + * define RSND_DEBUG_NO_DAI_CALL as 1 on top of core.c + * + * #define RSND_DEBUG_NO_DAI_CALL 1 + */ +#define rsnd_dbg_dai_call(dev, param...) \ + if (!IS_BUILTIN(RSND_DEBUG_NO_DAI_CALL)) \ + dev_dbg(dev, param) + #endif
participants (2)
-
Kuninori Morimoto
-
Mark Brown