From: sashiko-bot@kernel.org
To: "Praveen Talari" <praveen.talari@oss.qualcomm.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v2 3/4] spi: qcom-geni: Use resources helper APIs in runtime PM functions
Date: Sat, 30 May 2026 19:02:22 +0000 [thread overview]
Message-ID: <20260530190222.8C6B71F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260530-enable-spi-on-sa8255p-v2-3-17574601bd63@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Performance state (OPP) vote is dropped during suspend but never restored on resume, leading to hardware operating at zero voltage.
--
commit 60a92c010d0b0fc6d9cc73f3af65a2635a04cf3c
Author: Praveen Talari <praveen.talari@oss.qualcomm.com>
spi: qcom-geni: Use resources helper APIs in runtime PM functions
To manage GENI serial engine resources during runtime power management,
drivers currently need to call functions for ICC, clock, and
SE resource operations in both suspend and resume paths, resulting in
code duplication across drivers.
> diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
> index 333216df922e8..7696412c6e879 100644
> --- a/drivers/spi/spi-geni-qcom.c
> +++ b/drivers/spi/spi-geni-qcom.c
> @@ -1119,33 +1119,16 @@ static int __maybe_unused spi_geni_runtime_suspend(struct device *dev)
> {
> struct spi_controller *spi = dev_get_drvdata(dev);
> struct spi_geni_master *mas = spi_controller_get_devdata(spi);
> - int ret;
> -
> - /* Drop the performance state vote */
> - dev_pm_opp_set_rate(dev, 0);
> -
> - ret = geni_se_resources_off(&mas->se);
> - if (ret)
> - return ret;
>
> - return geni_icc_disable(&mas->se);
> + return geni_se_resources_deactivate(&mas->se);
> }
>
> static int __maybe_unused spi_geni_runtime_resume(struct device *dev)
> {
> struct spi_controller *spi = dev_get_drvdata(dev);
> struct spi_geni_master *mas = spi_controller_get_devdata(spi);
> - int ret;
> -
> - ret = geni_icc_enable(&mas->se);
> - if (ret)
> - return ret;
> -
> - ret = geni_se_resources_on(&mas->se);
> - if (ret)
> - return ret;
>
> - return dev_pm_opp_set_rate(mas->dev, mas->cur_sclk_hz);
> + return geni_se_resources_activate(&mas->se);
> }
[Severity: High]
How does the performance state (OPP) rate get restored on resume?
Before this patch, spi_geni_runtime_resume() explicitly restored the OPP
rate using dev_pm_opp_set_rate(mas->dev, mas->cur_sclk_hz).
While the new geni_se_resources_deactivate() helper continues to drop the
OPP rate to 0 on suspend, geni_se_resources_activate() does not restore it.
This seems to leave the hardware operating at zero voltage upon resume.
Furthermore, subsequent transfers won't reapply the rate because
geni_spi_set_clock_and_bw() has a fast-path optimization that skips setting
the clock if the requested frequency hasn't changed:
if (clk_hz == mas->cur_speed_hz)
return 0;
Will this lead to bus lockups or transfer timeouts due to operating without
adequate voltage votes?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260530-enable-spi-on-sa8255p-v2-0-17574601bd63@oss.qualcomm.com?part=3
next prev parent reply other threads:[~2026-05-30 19:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 18:28 [PATCH v2 0/4] Enable SPI on SA8255p Qualcomm platforms Praveen Talari
2026-05-30 18:28 ` [PATCH v2 1/4] spi: dt-bindings: describe SA8255p Praveen Talari
2026-05-30 18:38 ` sashiko-bot
2026-05-30 18:28 ` [PATCH v2 2/4] spi: qcom-geni: Use geni_se_resources_init() for resource initialization Praveen Talari
2026-05-30 18:52 ` sashiko-bot
2026-05-30 18:28 ` [PATCH v2 3/4] spi: qcom-geni: Use resources helper APIs in runtime PM functions Praveen Talari
2026-05-30 19:02 ` sashiko-bot [this message]
2026-05-30 18:28 ` [PATCH v2 4/4] spi: qcom-geni: Enable SPI on SA8255p Qualcomm platforms Praveen Talari
2026-05-30 19:12 ` 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=20260530190222.8C6B71F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=praveen.talari@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