From: sashiko-bot@kernel.org
To: "Sarath Ganapathiraju" <sarath.ganapathiraju@oss.qualcomm.com>
Cc: conor+dt@kernel.org, linux-clk@vger.kernel.org,
devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat pulse clock
Date: Thu, 17 Sep 2026 14:07:58 +0000 [thread overview]
Message-ID: <20260917140758.A0C651F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260917-master-v8-2-823d2c5d090a@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] clk: qcom: lpass: missing pm_clk callbacks causes unclocked hardware access
- [Medium] clk: qcom: lpass: async pm_runtime_put() races with devres pm_runtime_disable()
--
commit 5684759a56eb84ac05a7585939de6fdaa87b92de
Author: Sarath Ganapathiraju <sarath.ganapathiraju@oss.qualcomm.com>
clk: qcom: Add LPASS VA CSR heartbeat pulse clock
The HeartBeat Pulse, also known as RateGen Pulse, synchronizes the
start of DMAs and Codec Interfaces for the audio usecases and can
serve as a periodic wakeup source for the DSP. Add the LPASS VA CSR
driver that models the rate generator as a clock provider so it is
enabled and disabled automatically alongside the other clocks during
runtime PM resume and suspend. Attach the DT vote clocks to runtime PM
and resume the device before programming the rate generator registers,
so register accesses happen only after the LPASS votes are active.
> diff --git a/drivers/clk/qcom/lpass-va-csr.c b/drivers/clk/qcom/lpass-va-csr.c
> new file mode 100644
> index 0000000000000..3c87c3319f156
> --- /dev/null
> +++ b/drivers/clk/qcom/lpass-va-csr.c
[ ... ]
> + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_simple_get, &csr->hb.hw);
> + if (ret)
> + goto err_pm_runtime_put;
> +
> + pm_runtime_put(dev);
> +
> + return 0;
> +
> +err_pm_runtime_put:
> + pm_runtime_put(dev);
> +
> + return ret;
> +}
[Severity: Medium]
Will this asynchronous pm_runtime_put() race with the devres cleanup?
When probe fails, err_pm_runtime_put calls pm_runtime_put(), which queues an
asynchronous suspend. The probe function also uses devm_pm_runtime_enable(),
which queues a devres cleanup action that calls pm_runtime_disable() on
failure.
After the function returns, devres cleanup will invoke pm_runtime_disable(),
cancelling the pending asynchronous suspend request. This leaves the device
permanently active and its vote clocks enabled.
Could pm_runtime_put_sync() be used here instead to ensure the suspend
completes synchronously before devres cleanup?
[ ... ]
> +static struct platform_driver lpass_va_csr_driver = {
> + .driver = {
> + .name = "qcom-lpass-va-csr",
> + .of_match_table = lpass_va_csr_dt_match,
> + },
> + .probe = lpass_va_csr_probe,
> +};
[Severity: High]
Does this driver need a dev_pm_ops structure assigned to handle the PM clock
callbacks?
The driver registers DT vote clocks using of_pm_clk_add_clks(), relying on the
PM framework to enable them during runtime resume. Without assigning a
dev_pm_ops structure mapped to pm_clk_suspend and pm_clk_resume in the
platform_driver, pm_runtime_resume_and_get() sets the device state to active
but leaves the clocks physically disabled.
Will the subsequent regmap_write() attempts in probe try to access unclocked
hardware registers and trigger a synchronous external abort on Qualcomm
platforms?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260917-master-v8-0-823d2c5d090a@oss.qualcomm.com?part=2
next prev parent reply other threads:[~2026-09-17 14:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-17 13:57 [PATCH v8 0/2] Add LPASS VA CSR HeartBeat pulse clock support Sarath Ganapathiraju via B4 Relay
2026-09-17 13:57 ` [PATCH v8 1/2] dt-bindings: clock: qcom: Add LPASS VA CSR HeartBeat pulse clock Sarath Ganapathiraju via B4 Relay
2026-09-28 18:00 ` Rob Herring (Arm)
2026-09-17 13:57 ` [PATCH v8 2/2] clk: qcom: Add LPASS VA CSR heartbeat " Sarath Ganapathiraju via B4 Relay
2026-09-17 14:07 ` sashiko-bot [this message]
2026-09-17 16:08 ` Srinivas Kandagatla
2026-09-18 4:40 ` Prasad Kumpatla
2026-09-18 9:50 ` Konrad Dybcio
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=20260917140758.A0C651F00893@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=sarath.ganapathiraju@oss.qualcomm.com \
--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;
as well as URLs for NNTP newsgroup(s).