* [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints
@ 2025-06-19 12:11 Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging Peter Ujfalusi
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2025-06-19 12:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, guennadi.liakhovetski, liam.r.girdwood,
jyri.sarha
Hi,
The series harmonizes the debug prints for pipeline state changes.
Currently we only print readable state change for single pipeline
changes but when multiple pipeline's state is changed, it is omitted.
Use human readable information in both cases in a harmonized way to aid
debugging.
Regards,
Peter
---
Jyri Sarha (3):
ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging
ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in
multi_pipeline_state()
ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print
sound/soc/sof/ipc4-pcm.c | 27 ++++++++++++++++++++++++++-
sound/soc/sof/ipc4-priv.h | 3 +++
sound/soc/sof/ipc4.c | 25 +++++++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletion(-)
--
2.49.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging
2025-06-19 12:11 [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Peter Ujfalusi
@ 2025-06-19 12:11 ` Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 2/3] ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state() Peter Ujfalusi
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2025-06-19 12:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, guennadi.liakhovetski, liam.r.girdwood,
jyri.sarha
From: Jyri Sarha <jyri.sarha@linux.intel.com>
Add sof_ipc4_pipeline_state_str() to translate enum
sof_ipc4_pipeline_state into human readable form.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/soc/sof/ipc4-priv.h | 3 +++
sound/soc/sof/ipc4.c | 25 +++++++++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/sound/soc/sof/ipc4-priv.h b/sound/soc/sof/ipc4-priv.h
index 58b032820683..a256528e030f 100644
--- a/sound/soc/sof/ipc4-priv.h
+++ b/sound/soc/sof/ipc4-priv.h
@@ -123,4 +123,7 @@ size_t sof_ipc4_find_debug_slot_offset_by_type(struct snd_sof_dev *sdev,
void sof_ipc4_mic_privacy_state_change(struct snd_sof_dev *sdev, bool state);
+enum sof_ipc4_pipeline_state;
+const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state);
+
#endif
diff --git a/sound/soc/sof/ipc4.c b/sound/soc/sof/ipc4.c
index 37e837b22ac8..0b91bd443025 100644
--- a/sound/soc/sof/ipc4.c
+++ b/sound/soc/sof/ipc4.c
@@ -237,6 +237,26 @@ static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_ms
msg->extension, str);
}
}
+
+const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state)
+{
+ switch (state) {
+ case SOF_IPC4_PIPE_INVALID_STATE:
+ return " (INVALID_STATE)";
+ case SOF_IPC4_PIPE_UNINITIALIZED:
+ return " (UNINITIALIZED)";
+ case SOF_IPC4_PIPE_RESET:
+ return " (RESET)";
+ case SOF_IPC4_PIPE_PAUSED:
+ return " (PAUSED)";
+ case SOF_IPC4_PIPE_RUNNING:
+ return " (RUNNING)";
+ case SOF_IPC4_PIPE_EOS:
+ return " (EOS)";
+ default:
+ return " (<unknown>)";
+ }
+}
#else /* CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC */
static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_msg *msg,
bool data_size_valid)
@@ -254,6 +274,11 @@ static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_ms
else
dev_dbg(dev, "%s: %#x|%#x\n", text, msg->primary, msg->extension);
}
+
+const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state)
+{
+ return "";
+}
#endif
static void sof_ipc4_dump_payload(struct snd_sof_dev *sdev,
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state()
2025-06-19 12:11 [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging Peter Ujfalusi
@ 2025-06-19 12:11 ` Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 3/3] ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print Peter Ujfalusi
2025-06-20 11:32 ` [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2025-06-19 12:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, guennadi.liakhovetski, liam.r.girdwood,
jyri.sarha
From: Jyri Sarha <jyri.sarha@linux.intel.com>
Add a dev_dbg to sof_ipc4_set_multi_pipeline_state(). The debug print
lists the pipeline instance numbers that are included in the
SOF_IPC4_GLB_SET_PIPELINE_STATE message. Without this log its very
hard to tell what pipelines are affected. This print is very helpful
when analyzing SOF logs automatically.
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/soc/sof/ipc4-pcm.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c
index 8eee3e1aadf9..be4518d8970b 100644
--- a/sound/soc/sof/ipc4-pcm.c
+++ b/sound/soc/sof/ipc4-pcm.c
@@ -56,17 +56,41 @@ sof_ipc4_sps_to_time_info(struct snd_sof_pcm_stream *sps)
return stream_priv->time_info;
}
+static
+char *sof_ipc4_set_multi_pipeline_state_debug(struct snd_sof_dev *sdev, char *buf, size_t size,
+ struct ipc4_pipeline_set_state_data *trigger_list)
+{
+ int i, offset = 0;
+
+ for (i = 0; i < trigger_list->count; i++) {
+ offset += snprintf(buf + offset, size - offset, " %d",
+ trigger_list->pipeline_instance_ids[i]);
+
+ if (offset >= size - 1) {
+ buf[size - 1] = '\0';
+ break;
+ }
+ }
+ return buf;
+}
+
static int sof_ipc4_set_multi_pipeline_state(struct snd_sof_dev *sdev, u32 state,
struct ipc4_pipeline_set_state_data *trigger_list)
{
struct sof_ipc4_msg msg = {{ 0 }};
u32 primary, ipc_size;
+ char debug_buf[32];
/* trigger a single pipeline */
if (trigger_list->count == 1)
return sof_ipc4_set_pipeline_state(sdev, trigger_list->pipeline_instance_ids[0],
state);
+ dev_dbg(sdev->dev, "Set pipelines %s to state %d%s",
+ sof_ipc4_set_multi_pipeline_state_debug(sdev, debug_buf, sizeof(debug_buf),
+ trigger_list),
+ state, sof_ipc4_pipeline_state_str(state));
+
primary = state;
primary |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_GLB_SET_PIPELINE_STATE);
primary |= SOF_IPC4_MSG_DIR(SOF_IPC4_MSG_REQUEST);
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print
2025-06-19 12:11 [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 2/3] ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state() Peter Ujfalusi
@ 2025-06-19 12:11 ` Peter Ujfalusi
2025-06-20 11:32 ` [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Peter Ujfalusi @ 2025-06-19 12:11 UTC (permalink / raw)
To: lgirdwood, broonie
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, guennadi.liakhovetski, liam.r.girdwood,
jyri.sarha
From: Jyri Sarha <jyri.sarha@linux.intel.com>
Harmonize sof_ipc4_set_pipeline_state() dbg print with the new print
in sof_ipc4_set_multi_pipeline_state().
Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Liam Girdwood <liam.r.girdwood@intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
sound/soc/sof/ipc4-pcm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/sof/ipc4-pcm.c b/sound/soc/sof/ipc4-pcm.c
index be4518d8970b..cf809959eaea 100644
--- a/sound/soc/sof/ipc4-pcm.c
+++ b/sound/soc/sof/ipc4-pcm.c
@@ -113,7 +113,8 @@ int sof_ipc4_set_pipeline_state(struct snd_sof_dev *sdev, u32 instance_id, u32 s
struct sof_ipc4_msg msg = {{ 0 }};
u32 primary;
- dev_dbg(sdev->dev, "ipc4 set pipeline instance %d state %d", instance_id, state);
+ dev_dbg(sdev->dev, "Set pipeline %d to state %d%s", instance_id, state,
+ sof_ipc4_pipeline_state_str(state));
primary = state;
primary |= SOF_IPC4_GLB_PIPE_STATE_ID(instance_id);
--
2.49.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints
2025-06-19 12:11 [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Peter Ujfalusi
` (2 preceding siblings ...)
2025-06-19 12:11 ` [PATCH 3/3] ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print Peter Ujfalusi
@ 2025-06-20 11:32 ` Mark Brown
3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2025-06-20 11:32 UTC (permalink / raw)
To: lgirdwood, Peter Ujfalusi
Cc: linux-sound, kai.vehmanen, ranjani.sridharan, yung-chuan.liao,
pierre-louis.bossart, guennadi.liakhovetski, liam.r.girdwood,
jyri.sarha
On Thu, 19 Jun 2025 15:11:18 +0300, Peter Ujfalusi wrote:
> The series harmonizes the debug prints for pipeline state changes.
>
> Currently we only print readable state change for single pipeline
> changes but when multiple pipeline's state is changed, it is omitted.
>
> Use human readable information in both cases in a harmonized way to aid
> debugging.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging
commit: ecd41e0e2581d60f5268ad662065d17e0f049539
[2/3] ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state()
commit: 0e57fa20678d2d2dc0f047f052bb509c8f3ebc3b
[3/3] ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print
commit: 2756b7f08ff6ca7c68c8c7dd61c8dc6895c9de34
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-06-20 11:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-19 12:11 [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 1/3] ASoC: SOF: ipc4: Add sof_ipc4_pipeline_state_str() for debugging Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 2/3] ASoC: SOF: ipc4-pcm: Pipe instances to dev_dbg in multi_pipeline_state() Peter Ujfalusi
2025-06-19 12:11 ` [PATCH 3/3] ASoC: SOF: ipc4-pcm: Harmonize sof_ipc4_set_pipeline_state() dbg print Peter Ujfalusi
2025-06-20 11:32 ` [PATCH 0/3] ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg prints Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox