Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Srinivas Kandagatla" <srinivas.kandagatla@oss.qualcomm.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [RFC PATCH 2/8] ASoC: SDCA: allow building without ACPI
Date: Wed, 22 Jul 2026 23:59:37 +0000	[thread overview]
Message-ID: <20260722235938.256431F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260722234221.884765-3-srinivas.kandagatla@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] Unbounded recursion in `set_input_terminal_sources()` can lead to a kernel stack overflow if the firmware-provided SDCA topology graph contains a cycle.
- [Medium] The commit message and `SND_SOC_SDCA` Kconfig help text claim non-ACPI SDCA topology is supplied via `sdca_class_hw_ops.get_function_data`, but this API does not exist.
--

--- Patch [2]: [RFC PATCH 2/8] ASoC: SDCA: allow building without ACPI ---
commit b04522a00403ca00a5d4ee2768eab7c24cb31da7
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

ASoC: SDCA: allow building without ACPI

This commit drops the ACPI dependency for the SDCA class driver to allow
building on non-ACPI platforms. It also guards ACPI-parsing implementations
with IS_ENABLED(CONFIG_ACPI), providing empty stubs when ACPI is disabled.

> The SDCA class driver is useful on non-ACPI platforms where the
> topology is supplied statically via sdca_class_hw_ops.get_function_data.

[Severity: Medium]
Does this API actually exist in the kernel tree? Searching for
sdca_class_hw_ops or get_function_data yields no definitions. Is there a
missing patch that introduces this mechanism for codec drivers to supply
topology data on non-ACPI platforms?

> diff --git a/sound/soc/sdca/Kconfig b/sound/soc/sdca/Kconfig
> index 4c0dcb9ff3b94..dc4cba1e3e0ed 100644
> --- a/sound/soc/sdca/Kconfig
> +++ b/sound/soc/sdca/Kconfig
> @@ -3,11 +3,13 @@ menu "SoundWire (SDCA)"
>  
>  config SND_SOC_SDCA
>  	tristate "SDCA core support"
> -	depends on ACPI
>  	select AUXILIARY_BUS
>  	help
>  	  This option enables support for the MIPI SoundWire Device
> -	  Class for Audio (SDCA).
> +	  Class for Audio (SDCA).  The ACPI/DisCo topology parser is
> +	  only built when CONFIG_ACPI is enabled; on non-ACPI platforms
> +	  (e.g. ARM/DT) codec drivers supply the SDCA function data
> +	  via sdca_class_hw_ops.get_function_data.

[Severity: Medium]
Similar to the commit message, this help text points developers to
sdca_class_hw_ops.get_function_data. Since this interface doesn't seem to be
defined anywhere, should this documentation be updated to reflect the actual
mechanism used by codec drivers?

While reviewing this code, I also noticed a potential regression in the
topology parsing logic:

sound/soc/sdca/sdca_asoc.c:set_input_terminal_sources() {
    ...
		ret = set_input_terminal_sources(dev, regmap, function, src,
						 channels, rate, width);
    ...
}

[Severity: High]
Can this recursive call cause a kernel stack overflow if the firmware-provided
SDCA topology graph contains a cycle?

The graph of SDCA entities is populated directly from external firmware data,
such as ACPI _DSD. The traversal appears to lack cycle detection (like a
visited bitmask) or a recursion depth limit.

If a malformed or malicious firmware blob provides a cyclic connection, such
as Entity A connecting to Entity B and back to Entity A, would this function
recurse infinitely and exhaust the stack during device probing?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260722234221.884765-1-srinivas.kandagatla@oss.qualcomm.com?part=2

  reply	other threads:[~2026-07-22 23:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-22 23:42 [RFC PATCH 0/8] ASoC: SDCA: enable on DT platforms and add Qualcomm WCD9378 (Tambora) codec Srinivas Kandagatla
2026-07-22 23:42 ` [RFC PATCH 1/8] ASoC: SDCA: hw_params: program upstream Input Terminals for OT DAI Srinivas Kandagatla
2026-07-22 23:54   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 2/8] ASoC: SDCA: allow building without ACPI Srinivas Kandagatla
2026-07-22 23:59   ` sashiko-bot [this message]
2026-07-22 23:42 ` [RFC PATCH 3/8] ASoC: SDCA: expose class helpers with hw_ops for non-DisCo platforms Srinivas Kandagatla
2026-07-22 23:58   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 4/8] ASoC: SDCA: add PDE pre/post-pmu hooks to hw_ops Srinivas Kandagatla
2026-07-22 23:56   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 5/8] ASoC: SDCA: class_function: xlate sound-dai cell by entity index Srinivas Kandagatla
2026-07-22 23:57   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 6/8] ASoC: SDCA: register SDCA_FUNCTION_TYPE_SIMPLE_JACK in class function driver Srinivas Kandagatla
2026-07-22 23:56   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 7/8] dt-bindings: sound: qcom: add Tambora WCD9378 SDCA codec Srinivas Kandagatla
2026-07-22 23:51   ` sashiko-bot
2026-07-22 23:42 ` [RFC PATCH 8/8] ASoC: codecs: add Qualcomm Tambora (WCD9378) " Srinivas Kandagatla
2026-07-23  0:03   ` sashiko-bot

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=20260722235938.256431F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=srinivas.kandagatla@oss.qualcomm.com \
    /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