Re: [PATCH v1 4/5] ASoC: qcom: common: Distinguish missing and invalid TDM slot configuration

[email protected]
Newsgroups org.kernel.vger.linux-devicetree
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incomplete API update breaks TDM configuration parsing and error handling in the sc8280xp machine driver.
--

--- Patch [4]: [PATCH v1 4/5] ASoC: qcom: common: Distinguish missing and invalid TDM slot configuration ---
commit 2828c15bbb01105bac7c7698b0dd46a75894895f
Author: Prasad Kumpatla <[email protected]>

ASoC: qcom: common: Distinguish missing and invalid TDM slot configuration

This commit modifies the TDM slot configuration parser to return -ENOENT for
missing DAI-link configuration while preserving -EINVAL for malformed
properties. It also updates qcom_snd_apply_dai_tdm_slots() to handle the new
-ENOENT return code.

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
[ ... ]
> @@ -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 this API change break other callers that were not updated?

Looking at sc8280xp_tdm_hw_params() in sound/soc/qcom/sc8280xp.c, it still
expects -EINVAL for missing TDM configuration:

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 hw_params to fail when TDM configuration is intentionally
missing, since it now receives -ENOENT?

Could this also silently succeed on malformed configurations that return
-EINVAL, defeating the intent of the patch?

>  
>  	return qcom_snd_apply_dai_tdm_slots_cfg(rtd, &cpu_cfg, &codec_cfg);
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
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.