Commit 6974857c authored by Cezary Rojewski's avatar Cezary Rojewski Committed by Mark Brown

ASoC: topology: Do not ignore route checks when parsing graphs

One of the framework responsibilities is to ensure that the enumerated
DPCMs are valid i.e.: a valid BE is connected to a valid FE DAI. While
the are checks in soc-core.c and soc-pcm.c that verify this, a component
driver may attempt to workaround this by loading an invalid graph
through the topology file.

Be strict and fail topology loading when invalid graph is encountered.
Signed-off-by: default avatarCezary Rojewski <cezary.rojewski@intel.com>
Link: https://msgid.link/r/20240308090502.2136760-3-cezary.rojewski@intel.comReviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0cb3b7fd
...@@ -1083,8 +1083,15 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, ...@@ -1083,8 +1083,15 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg,
break; break;
} }
/* add route, but keep going if some fail */ ret = snd_soc_dapm_add_routes(dapm, route, 1);
snd_soc_dapm_add_routes(dapm, route, 1); if (ret) {
if (!dapm->card->disable_route_checks) {
dev_err(tplg->dev, "ASoC: dapm_add_routes failed: %d\n", ret);
break;
}
dev_info(tplg->dev,
"ASoC: disable_route_checks set, ignoring dapm_add_routes errors\n");
}
} }
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment