Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Un-updated caller sc8280xp_tdm_hw_params() causes PCM initialization failure for missing TDM configurations and ignores malformed ones.
--
--- Patch [3]: [PATCH v2 3/4] ASoC: qcom: common: Distinguish missing and invalid TDM slot configuration ---
commit 6f19acb6aca2ed0950dcc6a8cc707f166eb0eb8c
Author: Prasad Kumpatla <[email protected]>
ASoC: qcom: common: Distinguish missing and invalid TDM slot configuration
Return -ENOENT for missing DAI-link configuration and preserve -EINVAL
for malformed TDM slot properties.
Link: https://sashiko.dev/#/patchset/[email protected]
> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index d231024206dbf..d9f256d519733 100644
> --- a/sound/soc/qcom/common.c
> +++ b/sound/soc/qcom/common.c
> @@ -103,14 +103,14 @@ static int qcom_snd_parse_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd,
> int ret;
>
> if (!link_np)
> - return -EINVAL;
> + return -ENOENT;
>
> struct device_node *cpu_np __free(device_node) =
> of_get_child_by_name(link_np, "cpu");
> struct device_node *codec_np __free(device_node) =
> of_get_child_by_name(link_np, "codec");
> if (!cpu_np || !codec_np)
> - return -EINVAL;
> + return -ENOENT;
>
> ret = qcom_snd_parse_tdm_slot(cpu_np, cpu_cfg);
> if (ret)
> @@ -172,7 +172,7 @@ int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd)
>
> ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
> if (ret)
> - return ret == -EINVAL ? 0 : ret;
> + return ret == -ENOENT ? 0 : ret;
[Severity: High]
Does changing the return value here also require an update to
sc8280xp_tdm_hw_params() in sound/soc/qcom/sc8280xp.c?
Looking at sc8280xp_tdm_hw_params(), it calls qcom_snd_get_dai_tdm_slots()
which now returns -ENOENT for missing configurations. However, it still
appears to check for -EINVAL:
sound/soc/qcom/sc8280xp.c:sc8280xp_tdm_hw_params() {
...
ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
if (ret)
return ret == -EINVAL ? 0 : ret;
...
}
Will this cause sc8280xp_tdm_hw_params() to mistakenly return an error
(-ENOENT) when the configuration is missing, and incorrectly ignore the
error (-EINVAL) when the configuration is actually malformed?
>
> return qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.