Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: ipc4-pcm: Harmonize set pipeline state dbg

Merge series from Peter Ujfalusi <peter.ujfalusi@linux.intel.com>:

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.

+54 -1
+26 -1
sound/soc/sof/ipc4-pcm.c
··· 56 56 return stream_priv->time_info; 57 57 } 58 58 59 + static 60 + char *sof_ipc4_set_multi_pipeline_state_debug(struct snd_sof_dev *sdev, char *buf, size_t size, 61 + struct ipc4_pipeline_set_state_data *trigger_list) 62 + { 63 + int i, offset = 0; 64 + 65 + for (i = 0; i < trigger_list->count; i++) { 66 + offset += snprintf(buf + offset, size - offset, " %d", 67 + trigger_list->pipeline_instance_ids[i]); 68 + 69 + if (offset >= size - 1) { 70 + buf[size - 1] = '\0'; 71 + break; 72 + } 73 + } 74 + return buf; 75 + } 76 + 59 77 static int sof_ipc4_set_multi_pipeline_state(struct snd_sof_dev *sdev, u32 state, 60 78 struct ipc4_pipeline_set_state_data *trigger_list) 61 79 { 62 80 struct sof_ipc4_msg msg = {{ 0 }}; 63 81 u32 primary, ipc_size; 82 + char debug_buf[32]; 64 83 65 84 /* trigger a single pipeline */ 66 85 if (trigger_list->count == 1) 67 86 return sof_ipc4_set_pipeline_state(sdev, trigger_list->pipeline_instance_ids[0], 68 87 state); 88 + 89 + dev_dbg(sdev->dev, "Set pipelines %s to state %d%s", 90 + sof_ipc4_set_multi_pipeline_state_debug(sdev, debug_buf, sizeof(debug_buf), 91 + trigger_list), 92 + state, sof_ipc4_pipeline_state_str(state)); 69 93 70 94 primary = state; 71 95 primary |= SOF_IPC4_MSG_TYPE_SET(SOF_IPC4_GLB_SET_PIPELINE_STATE); ··· 113 89 struct sof_ipc4_msg msg = {{ 0 }}; 114 90 u32 primary; 115 91 116 - dev_dbg(sdev->dev, "ipc4 set pipeline instance %d state %d", instance_id, state); 92 + dev_dbg(sdev->dev, "Set pipeline %d to state %d%s", instance_id, state, 93 + sof_ipc4_pipeline_state_str(state)); 117 94 118 95 primary = state; 119 96 primary |= SOF_IPC4_GLB_PIPE_STATE_ID(instance_id);
+3
sound/soc/sof/ipc4-priv.h
··· 126 126 127 127 void sof_ipc4_mic_privacy_state_change(struct snd_sof_dev *sdev, bool state); 128 128 129 + enum sof_ipc4_pipeline_state; 130 + const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state); 131 + 129 132 #endif
+25
sound/soc/sof/ipc4.c
··· 237 237 msg->extension, str); 238 238 } 239 239 } 240 + 241 + const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state) 242 + { 243 + switch (state) { 244 + case SOF_IPC4_PIPE_INVALID_STATE: 245 + return " (INVALID_STATE)"; 246 + case SOF_IPC4_PIPE_UNINITIALIZED: 247 + return " (UNINITIALIZED)"; 248 + case SOF_IPC4_PIPE_RESET: 249 + return " (RESET)"; 250 + case SOF_IPC4_PIPE_PAUSED: 251 + return " (PAUSED)"; 252 + case SOF_IPC4_PIPE_RUNNING: 253 + return " (RUNNING)"; 254 + case SOF_IPC4_PIPE_EOS: 255 + return " (EOS)"; 256 + default: 257 + return " (<unknown>)"; 258 + } 259 + } 240 260 #else /* CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC */ 241 261 static void sof_ipc4_log_header(struct device *dev, u8 *text, struct sof_ipc4_msg *msg, 242 262 bool data_size_valid) ··· 273 253 msg->primary, msg->extension, msg->data_size); 274 254 else 275 255 dev_dbg(dev, "%s: %#x|%#x\n", text, msg->primary, msg->extension); 256 + } 257 + 258 + const char *sof_ipc4_pipeline_state_str(enum sof_ipc4_pipeline_state state) 259 + { 260 + return ""; 276 261 } 277 262 #endif 278 263