All of lore.kernel.org
 help / color / mirror / Atom feed
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 v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers
Date: Tue, 04 Aug 2026 07:18:31 +0000	[thread overview]
Message-ID: <20260804071831.B28641F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260804070307.117119-7-prasad.kumpatla@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Silent masking of device tree configuration errors due to conflated error codes.
--

--- Patch [6]: [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers ---
commit 59f92682a3e73f6ecf0f09ddbbaa5f3be6fc0e76
Author: Prasad Kumpatla <prasad.kumpatla@oss.qualcomm.com>

ASoC: qcom: common: add DAI-node TDM slot helpers

Add common helpers to parse standard dai-tdm-slot-* properties from the
CPU and codec child nodes of a backend DAI link and apply the result to
the active DAIs.

> diff --git a/sound/soc/qcom/common.c b/sound/soc/qcom/common.c
> index f8782e5cfaaea..d231024206dbf 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 ignore invalid TDM configurations in the device tree?

When qcom_snd_normalize_tdm_slots() detects an invalid configuration, like
mismatched slot counts or missing slot widths, it returns -EINVAL.

However, it looks like qcom_snd_apply_dai_tdm_slots() conflates this -EINVAL
return with the "not a TDM link" condition (which qcom_snd_parse_dai_tdm_slots()
also reports as -EINVAL when a link node is missing) and unconditionally
converts it to 0 (success).

Does this need to differentiate between a missing link node and an invalid
configuration to avoid masking configuration errors?

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

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260804070307.117119-1-prasad.kumpatla@oss.qualcomm.com?part=6

  reply	other threads:[~2026-08-04  7:18 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  7:03 [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 1/7] ASoC: qcom: qdsp6: add topology-driven Audio IF support Prasad Kumpatla
2026-08-04  7:16   ` sashiko-bot
2026-08-04 17:46   ` Cezary Rojewski
2026-08-04 17:50     ` Mark Brown
2026-08-04 17:58       ` Cezary Rojewski
2026-08-04  7:03 ` [PATCH v7 2/7] ASoC: qcom: q6apm-lpass-dais: add TDM DAI operations Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 3/7] dt-bindings: sound: qcom,q6dsp-lpass-ports: add Audio IF clocks Prasad Kumpatla
2026-08-04  7:08   ` sashiko-bot
2026-08-04 20:16   ` Rob Herring
2026-08-05  4:40     ` Prasad Kumpatla
2026-08-05  6:10       ` Krzysztof Kozlowski
2026-08-05  6:29         ` Prasad Kumpatla
2026-08-05  6:33           ` Krzysztof Kozlowski
2026-08-05  6:36             ` Krzysztof Kozlowski
2026-08-05  6:50             ` Prasad Kumpatla
2026-08-04  7:03 ` [PATCH v7 4/7] ASoC: qcom: q6prm: add Audio IF clock IDs Prasad Kumpatla
2026-08-04  7:11   ` sashiko-bot
2026-08-04  7:03 ` [PATCH v7 5/7] dt-bindings: sound: qcom,sm8250: allow TDM slot properties Prasad Kumpatla
2026-08-04  7:17   ` sashiko-bot
2026-08-04  7:03 ` [PATCH v7 6/7] ASoC: qcom: common: add DAI-node TDM slot helpers Prasad Kumpatla
2026-08-04  7:18   ` sashiko-bot [this message]
2026-08-04  7:03 ` [PATCH v7 7/7] ASoC: qcom: sc8280xp: add TDM hw_params support Prasad Kumpatla
2026-08-04  7:23   ` sashiko-bot
2026-08-04 16:32 ` [PATCH v7 0/7] ASoC: qcom: add AudioReach TDM backend support Mark Brown

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=20260804071831.B28641F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.