Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion sound/soc/sof/ipc3-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ static int sof_ipc3_widget_setup_comp_mixer(struct snd_sof_widget *swidget)
static int sof_ipc3_widget_setup_comp_pipeline(struct snd_sof_widget *swidget)
{
struct snd_soc_component *scomp = swidget->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct snd_sof_pipeline *spipe = swidget->spipe;
struct sof_ipc_pipe_new *pipeline;
struct snd_sof_widget *comp_swidget;
Expand Down Expand Up @@ -559,8 +560,15 @@ static int sof_ipc3_widget_setup_comp_pipeline(struct snd_sof_widget *swidget)
if (ret < 0)
goto err;

if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE))
if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) {
pipeline->core = SOF_DSP_PRIMARY_CORE;
} else if (pipeline->core > sdev->num_cores - 1) {
dev_info(scomp->dev,
"out of range core id for %s, moving it %d -> %d\n",
swidget->widget->name, pipeline->core,
SOF_DSP_PRIMARY_CORE);
pipeline->core = SOF_DSP_PRIMARY_CORE;
}

if (sof_debug_check_flag(SOF_DBG_DYNAMIC_PIPELINES_OVERRIDE))
swidget->dynamic_pipeline_widget =
Expand Down
11 changes: 11 additions & 0 deletions sound/soc/sof/ipc4-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ static void sof_ipc4_widget_free_comp_dai(struct snd_sof_widget *swidget)
static int sof_ipc4_widget_setup_comp_pipeline(struct snd_sof_widget *swidget)
{
struct snd_soc_component *scomp = swidget->scomp;
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct sof_ipc4_pipeline *pipeline;
struct snd_sof_pipeline *spipe = swidget->spipe;
int ret;
Expand All @@ -937,6 +938,16 @@ static int sof_ipc4_widget_setup_comp_pipeline(struct snd_sof_widget *swidget)
goto err;
}

if (sof_debug_check_flag(SOF_DBG_DISABLE_MULTICORE)) {
pipeline->core_id = SOF_DSP_PRIMARY_CORE;
} else if (pipeline->core_id > sdev->num_cores - 1) {
dev_info(scomp->dev,
"out of range core id for %s, moving it %d -> %d\n",
swidget->widget->name, pipeline->core_id,
SOF_DSP_PRIMARY_CORE);
pipeline->core_id = SOF_DSP_PRIMARY_CORE;
}

swidget->core = pipeline->core_id;
spipe->core_mask |= BIT(pipeline->core_id);

Expand Down
9 changes: 8 additions & 1 deletion sound/soc/sof/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1565,8 +1565,15 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
int core = sof_get_token_value(SOF_TKN_COMP_CORE_ID, swidget->tuples,
swidget->num_tuples);

if (core >= 0)
if (core >= 0) {
if (core > sdev->num_cores - 1) {
dev_info(scomp->dev,
"out of range core id for %s, moving it %d -> %d\n",
swidget->widget->name, core, SOF_DSP_PRIMARY_CORE);
core = SOF_DSP_PRIMARY_CORE;
}
swidget->core = core;
}
}

/* bind widget to external event */
Expand Down
Loading