All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Praveen Talari" <praveen.talari@oss.qualcomm.com>
Cc: linux-serial@vger.kernel.org
Subject: Re: [PATCH v2 4/9] soc: qcom: geni-se: Remove OPP rate reset from resource deactivation
Date: Thu, 27 Aug 2026 18:14:42 +0000	[thread overview]
Message-ID: <20260827181442.E04EC1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260827-derive_clk_perf_tbl_from_perf_domain_opp_table-v2-4-091697dbeb02@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:

New issues:
- [Low] Stale docstring in geni_se_resources_activate() referencing removed behavior of geni_se_resources_deactivate()

Pre-existing issues:
- [High] Teardown asymmetry and broken error path in geni_se_resources_deactivate() leading to unclocked access crashes.
--

commit b2f71df99b253ff18b7c7e30383a3f897e2d8b04
Author: Praveen Talari <praveen.talari@oss.qualcomm.com>

soc: qcom: geni-se: Remove OPP rate reset from resource deactivation

Remove the dev_pm_opp_set_rate() call from geni_se_resources_deactivate().
OPP resource management should be controlled by the consumer driver, and
the clocks are already disabled making the rate reset unnecessary.

> diff --git a/drivers/soc/qcom/qcom-geni-se.c b/drivers/soc/qcom/qcom-geni-se.c
> index 04f58a6f26fff..d4f0544d73c49 100644
> --- a/drivers/soc/qcom/qcom-geni-se.c
> +++ b/drivers/soc/qcom/qcom-geni-se.c
> @@ -1039,8 +1039,8 @@ EXPORT_SYMBOL_GPL(geni_icc_disable);
>   * geni_se_resources_deactivate() - Deactivate GENI SE device resources
>   * @se: Pointer to the geni_se structure
>   *
> - * Deactivates device resources for power saving: OPP rate to 0, pin control
> - * to sleep state, turns off clocks, and disables interconnect. Skips ACPI devices.
> + * Deactivates device resources for power saving: pin control to sleep
> + * state, turns off clocks, and disables interconnect. Skips ACPI devices.
>   *
>   * Return: 0 on success, negative error code on failure
>   */
> @@ -1051,9 +1051,6 @@ int geni_se_resources_deactivate(struct geni_se *se)
>  	if (has_acpi_companion(se->dev))
>  		return 0;
>  
> -	if (se->has_opp)
> -		dev_pm_opp_set_rate(se->dev, 0);
> -

[Severity: Low]
Does this make the docstring in geni_se_resources_activate() stale?

The docstring for geni_se_resources_activate() says:

 * Unlike geni_se_resources_deactivate(), this function doesn't alter the
 * connected genpds' performance states, which must be additionally handled.

Since the dev_pm_opp_set_rate() call is removed here, is there still an
asymmetry between these two functions?

[Severity: High]
This is a pre-existing issue, but can the error path in
geni_se_resources_deactivate() lead to system crashes?

Looking at the rest of geni_se_resources_deactivate() below this change:

	geni_se_clks_off(se);

	return geni_icc_disable(se);

If geni_icc_disable() fails (for instance, a timeout in icc_set_bw()), it
returns an error to the caller after geni_se_clks_off() has already turned
off the clocks.

Because the PM core sees an error returned from the deactivation, it aborts
suspend and keeps the device in an active state. Later register accesses
bypass runtime resume, and since the clocks are actually disabled, this
triggers an immediate synchronous external abort.

Also, within geni_icc_disable():

	ret = icc_disable(se->icc_paths[i].path);
	if (ret) {
		dev_err_ratelimited(se->dev, "ICC disable failed on path '%s': %d\n",
				icc_path_names[i], ret);
		return ret;
	}

If one path fails to disable, it returns immediately without re-enabling
previously disabled interconnect paths, compounding the partial teardown
state.

>  	ret = pinctrl_pm_select_sleep_state(se->dev);
>  	if (ret)
>  		return ret;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260827-derive_clk_perf_tbl_from_perf_domain_opp_table-v2-0-091697dbeb02@oss.qualcomm.com?part=4

  reply	other threads:[~2026-08-27 18:14 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-27 17:59 [PATCH v2 0/9] soc: qcom: geni: Derive SE clock configuration from OPP table on SA8255P Praveen Talari
2026-08-27 17:59 ` [PATCH v2 1/9] pmdomain: arm: Fix -EINVAL from scmi_pd_set_perf_state() on state 0 Praveen Talari
2026-08-27 18:16   ` sashiko-bot
2026-09-01 14:31   ` Ulf Hansson
2026-08-27 17:59 ` [PATCH v2 2/9] soc: qcom: geni-se: Populate clk_perf_tbl with SE source clock frequencies from perf OPP table Praveen Talari
2026-08-27 18:16   ` sashiko-bot
2026-10-07  7:24   ` Mukesh Savaliya
2026-08-27 17:59 ` [PATCH v2 3/9] soc: qcom: geni-se: Add helper to set SE clock rate via OPP Praveen Talari
2026-08-27 18:14   ` sashiko-bot
2026-09-04  9:01   ` Konrad Dybcio
2026-08-27 17:59 ` [PATCH v2 4/9] soc: qcom: geni-se: Remove OPP rate reset from resource deactivation Praveen Talari
2026-08-27 18:14   ` sashiko-bot [this message]
2026-09-04  8:49   ` Konrad Dybcio
2026-09-11 17:13     ` Praveen Talari
2026-10-07  8:51   ` Mukesh Savaliya
2026-08-27 17:59 ` [PATCH v2 5/9] serial: qcom-geni: Use geni_se_set_rate() for source clock configuration Praveen Talari
2026-08-27 18:12   ` sashiko-bot
2026-10-08  7:35   ` Mukesh Savaliya
2026-08-27 17:59 ` [PATCH v2 6/9] spi: qcom-geni: Use geni_se_set_rate() for setting source clock frequency Praveen Talari
2026-08-27 18:12   ` sashiko-bot
2026-10-08 19:45   ` Mukesh Savaliya
2026-08-27 17:59 ` [PATCH v2 7/9] i2c: qcom-geni: Vote for SE clock rate using OPP Praveen Talari
2026-08-27 18:11   ` sashiko-bot
2026-09-04  8:52   ` Konrad Dybcio
2026-09-11 17:42     ` Praveen Talari
2026-08-27 17:59 ` [PATCH v2 8/9] i2c: qcom-geni: Use common GENI resource initialization helper Praveen Talari
2026-08-27 18:16   ` sashiko-bot
2026-08-27 17:59 ` [PATCH v2 9/9] i2c: qcom-geni: Use geni_se_set_rate() for setting source clock frequency Praveen Talari
2026-08-27 18:25   ` sashiko-bot
2026-09-01 14:52 ` [PATCH v2 0/9] soc: qcom: geni: Derive SE clock configuration from OPP table on SA8255P Ulf Hansson
2026-09-01 16:48   ` Praveen Talari
2026-09-04  7:56     ` Ulf Hansson
2026-09-04  9:00       ` Konrad Dybcio
2026-09-11 17:33         ` Praveen Talari
2026-09-22 13:06           ` Konrad Dybcio
2026-09-28  8:59             ` Praveen Talari
2026-09-09  6:32       ` Praveen Talari

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=20260827181442.E04EC1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=praveen.talari@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 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.