Re: [PATCH] cpuidle: psci: Skip SET_SUSPEND_MODE when OSI is unsupported

From: Ulf Hansson

Date: Sat Nov 14 2026 - 06:50:34 EST


On Thu, Nov 12, 2026 at 5:23 PM Patrick Delaunay
<patrick.delaunay@xxxxxxxxxxx> wrote:
>
> The PSCI cpuidle domain probe calls psci_set_osi_mode(use_osi) after
> creating the power domains. When OSI is unsupported, this still calls
> SET_SUSPEND_MODE to select platform-coordinated mode. Firmware that
> does not implement this optional function may return NOT_SUPPORTED,
> causing the probe to fail with -EOPNOTSUPP.
>
> When OSI is unsupported, the PSCI specification allows the OS to assume
> platform-coordinated mode. Skip the call in that case, and request OSI
> mode only when psci_has_osi_support() is true.
>
> Fixes: 12acb348fa45 ("cpuidle: psci: Move enabling OSI mode after power domains creation")
> Signed-off-by: Patrick Delaunay <patrick.delaunay@xxxxxxxxxxx>

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
> Hi,
>
> This patch replaces the previous patch [1] in SCMI lib
>
> The PSCI specification v1.3 describes the PSCI_SET_SUSPEND_MODE with:
>
> "
> 5.21 PSCI_SET_SUSPEND_MODE
> 5.21.3 Caller responsibilities
> The caller must be able to cope with the following error return codes:
> * NOT_SUPPORTED, in which case the calling OS can assume the platform
> will work in platform-coordinated mode. In this case,
> the PSCI_FEATURES feature flag 0 for CPU_SUSPEND is also 0.
> "
>
> This patch implements the expected behavior:
>
> PC mode by default when OSI is not supported, i.e. CPU_SUSPEND
> (optional) are not supported; PSCI_FEATURES(CPU_SUSPEND) return
> NOT_SUPPORTED or return psci_func_id Bit[0]=0 for OS-initiated mode
> not supported.
>
> When OSI is not supported PSCI_SET_SUSPEND_MODE (optional) can report
> NOT_SUPPORTED and by default the platform will boot in
> platform-coordinated mode.
>
> [1] "firmware: psci: handle unsupported SET_SUSPEND_MODE in PC mode"
> https://patchwork.kernel.org/project/linux-arm-kernel/patch/20261029191624.1.I5f8f3d75a566b72250d629ac6f43cf0d387c0218@changeid/
> https://lore.kernel.org/all/20261029191624.1.I5f8f3d75a566b72250d629ac6f43cf0d387c0218@changeid/
>
> Regards,
>
> Patrick
>
> drivers/cpuidle/cpuidle-psci-domain.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
> index 5722365b943e..eed9ad94659a 100644
> --- a/drivers/cpuidle/cpuidle-psci-domain.c
> +++ b/drivers/cpuidle/cpuidle-psci-domain.c
> @@ -159,10 +159,12 @@ 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 (use_osi) {
> + /* let's try to enable OSI. */
> + ret = psci_set_osi_mode(true);
> + if (ret)
> + goto remove_pd;
> + }
>
> pr_info("Initialized CPU PM domain topology using %s mode\n",
> use_osi ? "OSI" : "PC");
> ---
> base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb
> branch: master
>
> --
> 2.43.0
>