Unverified Commit 9822b4c9 authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown
Browse files

ASoC: SOF: ipc4-topology: Do not set ALH node_id for aggregated DAIs



For aggregated DAIs, the node ID is set to the group_id during the DAI
widget's ipc_prepare op. With the current logic, setting the dai_index
for node_id in the dai_config is redundant as it will be overwritten
with the group_id anyway. Removing it will also prevent any accidental
clearing/resetting of the group_id for aggregated DAIs due to the
dai_config calls could that happen before the allocated group_id is
freed.

Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
All: stable@vger.kernel.org # 6.10.x 6.11.x
Link: https://patch.msgid.link/20241016032910.14601-2-yung-chuan.liao@linux.intel.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 3692a4cc
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -3129,9 +3129,20 @@ static int sof_ipc4_dai_config(struct snd_sof_dev *sdev, struct snd_sof_widget *
		 * group_id during copier's ipc_prepare op.
		 */
		if (flags & SOF_DAI_CONFIG_FLAGS_HW_PARAMS) {
			struct sof_ipc4_alh_configuration_blob *blob;

			blob = (struct sof_ipc4_alh_configuration_blob *)ipc4_copier->copier_config;
			ipc4_copier->dai_index = data->dai_node_id;

			/*
			 * no need to set the node_id for aggregated DAI's. These will be assigned
			 * a group_id during widget ipc_prepare
			 */
			if (blob->alh_cfg.device_count == 1) {
				copier_data->gtw_cfg.node_id &= ~SOF_IPC4_NODE_INDEX_MASK;
			copier_data->gtw_cfg.node_id |= SOF_IPC4_NODE_INDEX(data->dai_node_id);
				copier_data->gtw_cfg.node_id |=
					SOF_IPC4_NODE_INDEX(data->dai_node_id);
			}
		}

		break;