From: sashiko-bot@kernel.org
To: "Prasad Kumpatla" <prasad.kumpatla@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers
Date: Sat, 01 Aug 2026 05:57:19 +0000 [thread overview]
Message-ID: <20260801055719.E447A1F00AC4@smtp.kernel.org> (raw)
In-Reply-To: <20260801054610.4047089-7-prasad.kumpatla@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] qcom_snd_apply_dai_tdm_slots() silently swallows validation errors from qcom_snd_normalize_tdm_slots(), hiding device tree misconfigurations.
--
--- Patch [6]: [PATCH v5 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers ---
commit f8d4d2026fa6be0ea3757ca3a1aa7c0d4b41e96e
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>
ASoC: qcom: common: add DAI-node TDM slot helpers
This patch adds common helpers to parse standard dai-tdm-slot-* properties
from the CPU and codec child nodes of a backend DAI link and applies the
result to the active DAIs. It provides configuration parsing, validation,
and an apply helper for callers.
> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index e4ff247ea47fd..cacf467bc2a76 100644
> --- a/sound/soc/qcom/common.c
> +++ b/sound/soc/qcom/common.c
[ ... ]
> +static int qcom_snd_normalize_tdm_slots(struct qcom_snd_tdm_slot_cfg *cpu_cfg,
> + struct qcom_snd_tdm_slot_cfg *codec_cfg)
> +{
> + unsigned int slots;
> + unsigned int slot_width;
> +
> + if (cpu_cfg->slots && codec_cfg->slots && cpu_cfg->slots != codec_cfg->slots)
> + return -EINVAL;
> +
> + if (cpu_cfg->slot_width && codec_cfg->slot_width &&
> + cpu_cfg->slot_width != codec_cfg->slot_width)
> + return -EINVAL;
[ ... ]
> +int qcom_snd_apply_dai_tdm_slots(struct snd_soc_pcm_runtime *rtd)
> +{
> + struct qcom_snd_tdm_slot_cfg cpu_cfg;
> + struct qcom_snd_tdm_slot_cfg codec_cfg;
> + int ret;
> +
> + ret = qcom_snd_get_dai_tdm_slots(rtd, &cpu_cfg, &codec_cfg);
> + if (ret)
> + return ret == -EINVAL ? 0 : ret;
[Severity: Medium]
Will this silently swallow validation errors from conflicting device tree
configurations?
While this logic appears intended to ignore -EINVAL when TDM nodes are simply
missing in qcom_snd_parse_dai_tdm_slots(), qcom_snd_normalize_tdm_slots()
also returns -EINVAL when there are contradictory settings (such as conflicting
slot counts or widths between CPU and codec nodes).
If a device tree is provided with contradictory TDM properties, won't this
result in the error being hidden and no TDM configuration being applied,
likely leading to silent audio failures instead of failing probe with an error?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260801054610.4047089-1-prasad.kumpatla@oss.qualcomm.com?part=6
next prev parent reply other threads:[~2026-08-01 5:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-01 5:46 [PATCH v5 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
2026-08-01 5:46 ` [PATCH v5 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
2026-08-01 5:57 ` sashiko-bot [this message]
2026-08-01 5:46 ` [PATCH v5 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260801055719.E447A1F00AC4@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=prasad.kumpatla@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox