Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Srinivas Kandagatla" <srinivas.kandagatla@oss.qualcomm.com>
Cc: robh@kernel.org, linux-clk@vger.kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH 3/4] clk: qcom: Add lpass audio clock controller driver for Glymur
Date: Tue, 22 Sep 2026 18:53:17 +0000	[thread overview]
Message-ID: <20260922185318.2D7771F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922184425.56114-4-srinivas.kandagatla@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] clk: qcom: regmap max_register restricts access to WSA3/WSA4 resets
- [Medium] clk: qcom: SC_LPASSCC_GLYMUR missing select CLK_GLYMUR_GCC dependency
- [Medium] clk: qcom: missing NULL check on of_device_get_match_data() result
--

commit a3d72a1f7ec423f2250c7ae64750a7f38d02a929
Author: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>

clk: qcom: Add lpass audio clock controller driver for Glymur

This commit adds support for the lpass audio clock controller found on
Glymur based devices. It allows lpass peripheral loader drivers to control
the clocks and bring the subsystems out of reset.

> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index d1fc9bf87126b..8a6c15ab9da7a 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -1177,6 +1177,17 @@ config SC_LPASSCC_8280XP
>  	  Say Y if you want to use the LPASS branch clocks of the LPASS clock
>  	  controller to reset the LPASS subsystem.
>  
> +config SC_LPASSCC_GLYMUR
> +	tristate "GLYMUR Low Power Audio Subsystem (LPASS) Clock Controller"
> +	depends on ARM64 || COMPILE_TEST

[Severity: Medium]
Does this Kconfig entry miss a dependency on the global clock controller?

If this driver is built without CLK_GLYMUR_GCC being enabled, can it lead
to unclocked register accesses and probe failures, since peripheral
controllers depend on GCC for AHB/AXI access?

Additionally, does the naming prefix SC_LPASSCC_GLYMUR diverge from the
standard CLK_GLYMUR_* prefix used by other Glymur clock controllers,
potentially violating cross-config consistency guidelines?

> +	default m if ARCH_QCOM
> +	help
> +	  Support for the LPASS clock controller on Glymur devices.
> +	  Say Y if you want to use the LPASS branch clocks of the LPASS clock
> +	  controller to reset the LPASS subsystem.  Required for the LPASS
> +	  audio macros and the SoundWire compute-mode controller to leave
> +	  reset on Glymur.

[ ... ]

> diff --git a/drivers/clk/qcom/lpasscc-glymur.c b/drivers/clk/qcom/lpasscc-glymur.c
> new file mode 100644
> index 0000000000000..97fc099983b62
> --- /dev/null
> +++ b/drivers/clk/qcom/lpasscc-glymur.c
> @@ -0,0 +1,70 @@

[ ... ]

> +static const struct qcom_reset_map lpass_audiocc_glymur_resets[] = {
> +	[LPASS_AUDIO_SWR_RX_CGCR] = { 0xA0, 1 },
> +	[LPASS_AUDIO_SWR_WSA1_CGCR] = { 0xB0, 1 },
> +	[LPASS_AUDIO_SWR_WSA2_CGCR] = { 0xD8, 1 },
> +	[LPASS_AUDIO_SWR_WSA3_CGCR] = { 0x300C, 1 },
> +	[LPASS_AUDIO_SWR_WSA4_CGCR] = { 0x301C, 1 },
> +};
> +
> +static const struct regmap_config lpass_audiocc_glymur_regmap_config = {
> +	.reg_bits = 32,
> +	.reg_stride = 4,
> +	.val_bits = 32,
> +	.name = "lpass-audio-csr",
> +	.max_register = 0x1000,

[Severity: High]
Does this max_register boundary of 0x1000 prevent access to the WSA3 and
WSA4 resets at offsets 0x300C and 0x301C defined above?

Will the regmap core reject attempts to assert or deassert those resets,
silently failing with -EIO and leaving the dependent audio blocks broken in
an undefined reset state?

> +};

[ ... ]

> +static int lpasscc_glymur_probe(struct platform_device *pdev)
> +{
> +	const struct qcom_cc_desc *desc = of_device_get_match_data(&pdev->dev);
> +

[Severity: Medium]
If the driver is bound manually to a non-DT platform device via sysfs, could
of_device_get_match_data() return NULL here?

If so, when desc is passed to qcom_cc_probe_by_index(), will it cause a
NULL pointer dereference when accessing desc->config?

> +	return qcom_cc_probe_by_index(pdev, 0, desc);
> +}

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

  reply	other threads:[~2026-09-22 18:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22 18:44 [PATCH 0/4] clk: qcom: Add LPASS clock/reset controllers for Glymur Srinivas Kandagatla
2026-09-22 18:44 ` [PATCH 1/4] dt-bindings: clock: Add LPASS AUDIOCC and reset controller " Srinivas Kandagatla
2026-09-22 18:54   ` sashiko-bot
2026-09-22 19:05     ` Srinivas Kandagatla
2026-09-28  9:59   ` Krzysztof Kozlowski
2026-09-28 10:00     ` Srinivas Kandagatla
2026-09-22 18:44 ` [PATCH 2/4] dt-bindings: clock: Add LPASSCC " Srinivas Kandagatla
2026-09-28  9:59   ` Krzysztof Kozlowski
2026-09-22 18:44 ` [PATCH 3/4] clk: qcom: Add lpass audio clock controller driver " Srinivas Kandagatla
2026-09-22 18:53   ` sashiko-bot [this message]
2026-09-22 20:40   ` Abel Vesa
2026-09-24  9:02   ` Taniya Das
2026-09-29 15:37   ` Uwe Kleine-König
2026-09-22 18:44 ` [PATCH 4/4] clk: qcom: Add lpass " Srinivas Kandagatla
2026-09-22 20:41   ` Abel Vesa

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=20260922185318.2D7771F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@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