All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Reza Kurniawan" <imkyufie@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch
Date: Sat, 17 Oct 2026 17:07:50 +0000	[thread overview]
Message-ID: <sashiko-outbox-175687@kernel.org> (raw)
In-Reply-To: <20261017-psci-fix-v1-2-dedae27e4a31@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] cpuidle: psci: skip-suspend-mode-switch ignored in psci_1_0_init()
--

commit ee7d5d7e060784375912b91f91b344ad1eecb0a8
Author: Alejandro Tafalla <atafalla@dnyon.com>

cpuidle: psci: Allow skipping the suspend mode switch

This commit adds support for the skip-suspend-mode-switch property in
psci_cpuidle_domain_probe() to skip calling psci_set_osi_mode() on
platforms whose firmware reports OSI mode support but rejects
PSCI_SET_SUSPEND_MODE calls.

> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> index 5722365b943ea..cc9f14769ba20 100644
> --- a/drivers/cpuidle/cpuidle-psci-domain.c
> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> @@ -159,13 +159,17 @@ static int psci_cpuidle_domain_probe(struct platform_device *pdev)
>  	if (ret)
>  		goto remove_pd;
>  
> -	/* let's try to enable OSI. */
> -	ret = psci_set_osi_mode(use_osi);
> -	if (ret)
> -		goto remove_pd;
> +	if (of_property_read_bool(np, "skip-suspend-mode-switch")) {
> +		pr_info("Initialized CPU PM domain topology, keeping firmware-set mode\n");
> +	} else {
> +		ret = psci_set_osi_mode(use_osi);

[Severity: Medium]
Should psci_1_0_init() in drivers/firmware/psci/psci.c also check the
skip-suspend-mode-switch property?

During early PSCI initialization, psci_dt_init() -> psci_1_0_init() runs
on the same /psci device_node and unconditionally calls
psci_set_osi_mode(false) when psci_has_osi_support() is true:

drivers/firmware/psci/psci.c:psci_1_0_init() {
    ...
	if (psci_has_osi_support()) {
		pr_info("OSI mode supported.\n");

		/* Default to PC mode. */
		psci_set_osi_mode(false);
	}
    ...
}

Because that call is not gated on skip-suspend-mode-switch, the kernel
still issues PSCI_1_0_FN_SET_SUSPEND_MODE at boot and logs a FW_BUG
message in psci_set_osi_mode() when the firmware rejects the switch to PC
mode.

Furthermore, if a firmware with skip-suspend-mode-switch boots in OSI mode
and accepts the switch to PC mode in psci_1_0_init(), wouldn't
psci_cpuidle_domain_probe() then initialize the CPU PM domains with
use_osi = psci_has_osi_support() (true) and skip switching back to OSI
mode, leaving the kernel in OSI mode while the firmware was switched to PC
mode?

> +		if (ret)
> +			goto remove_pd;
> +
> +		pr_info("Initialized CPU PM domain topology using %s mode\n",
> +			use_osi ? "OSI" : "PC");
> +	}
>  
> -	pr_info("Initialized CPU PM domain topology using %s mode\n",
> -		use_osi ? "OSI" : "PC");
>  	return 0;
>  
>  remove_pd:

iala

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261017-psci-fix-v1-0-dedae27e4a31@gmail.com?part=2

  reply	other threads:[~2026-10-17 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-17 16:41 [PATCH 0/4] Fix PSCI on MSM8917 and MSM8937 Reza Kurniawan
2026-10-17 16:41 ` [PATCH 1/4] dt-bindings: arm: psci: Add skip-suspend-mode-switch property Reza Kurniawan
2026-10-17 21:30   ` Val Packett
2026-10-17 16:41 ` [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch Reza Kurniawan
2026-10-17 17:07   ` sashiko-bot [this message]
2026-10-17 16:41 ` [PATCH 3/4] arm64: dts: qcom: Skip suspend mode switch on MSM8917 and MSM8937 Reza Kurniawan
2026-10-17 16:41 ` [PATCH 4/4] arm64: dts: qcom: msm8917: Use a shallower cluster state to fix unresponsive idle Reza Kurniawan

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=sashiko-outbox-175687@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imkyufie@gmail.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 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.