* [PATCH 0/4] Fix PSCI on MSM8917 and MSM8937
@ 2026-10-17 16:41 Reza Kurniawan
2026-10-17 16:41 ` [PATCH 1/4] dt-bindings: arm: psci: Add skip-suspend-mode-switch property Reza Kurniawan
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Reza Kurniawan @ 2026-10-17 16:41 UTC (permalink / raw)
To: Mark Rutland, Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
Christian Loehle, Bjorn Andersson, Konrad Dybcio, Abel Vesa
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-pm,
linux-arm-msm, Alejandro Tafalla, Reza Kurniawan
PSCI on Qualcomm MSM8917 and MSM8937 advertises support for OS-initiated
mode through PSCI_FEATURES, but rejects every PSCI_SET_SUSPEND_MODE call
with NOT_SUPPORTED. The cpuidle-psci-domain driver treats this as a
fatal error, so probe fails and the CPU PM domain topology is never
registered:
psci-cpuidle-domain psci: probe with driver psci-cpuidle-domain failed
with error -95
This series adds a "skip-suspend-mode-switch" property to the PSCI node.
When present, cpuidle-psci-domain does not call psci_set_osi_mode() and
continues with the topology it has already built.
Skipping the switch is expected to be safe on these platforms since it
matches the behavior of the downstream kernel, which manages the
cluster power level in addition to the CPU power level, just as Linux
does when OSI is supported.
Additionally, it also adds the property to the PSCI node for both
platforms. For MSM8917, additional change is added to fix the system
being unresponsive at idle.
---
Alejandro Tafalla (2):
dt-bindings: arm: psci: Add skip-suspend-mode-switch property
cpuidle: psci: Allow skipping the suspend mode switch
Reza Kurniawan (2):
arm64: dts: qcom: Skip suspend mode switch on MSM8917 and MSM8937
arm64: dts: qcom: msm8917: Use a shallower cluster state to fix unresponsive idle
Documentation/devicetree/bindings/arm/psci.yaml | 13 +++++++++++++
arch/arm64/boot/dts/qcom/msm8917.dtsi | 9 +++++----
arch/arm64/boot/dts/qcom/msm8937.dtsi | 1 +
drivers/cpuidle/cpuidle-psci-domain.c | 16 ++++++++++------
4 files changed, 29 insertions(+), 10 deletions(-)
---
base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
change-id: 20261013-psci-fix-8a2c0d6266fa
Best regards,
--
Reza Kurniawan <imkyufie@gmail.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] dt-bindings: arm: psci: Add skip-suspend-mode-switch property
2026-10-17 16:41 [PATCH 0/4] Fix PSCI on MSM8917 and MSM8937 Reza Kurniawan
@ 2026-10-17 16:41 ` Reza Kurniawan
2026-10-17 16:41 ` [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch Reza Kurniawan
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Reza Kurniawan @ 2026-10-17 16:41 UTC (permalink / raw)
To: Mark Rutland, Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
Christian Loehle, Bjorn Andersson, Konrad Dybcio, Abel Vesa
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-pm,
linux-arm-msm, Alejandro Tafalla, Reza Kurniawan
From: Alejandro Tafalla <atafalla@dnyon.com>
On some SoCs (e.g. Qualcomm MSM8917 and MSM8937), PSCI_FEATURES reports
that OS-initiated mode is supported, but every PSCI_SET_SUSPEND_MODE
call is rejected with NOT_SUPPORTED.
PSCI provides no call to read back the current suspend mode, so the OS
cannot tell which mode the firmware is operating in or why the switch
is rejected.
Add an optional flag that tells the OS not to issue
PSCI_SET_SUSPEND_MODE on such firmware.
Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
[Reza Kurniawan: split out the patch, rewrote the property description,
renamed the property]
Co-developed-by: Reza Kurniawan <imkyufie@gmail.com>
Signed-off-by: Reza Kurniawan <imkyufie@gmail.com>
---
Documentation/devicetree/bindings/arm/psci.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/arm/psci.yaml b/Documentation/devicetree/bindings/arm/psci.yaml
index 0d04389c81..7777077dd0 100644
--- a/Documentation/devicetree/bindings/arm/psci.yaml
+++ b/Documentation/devicetree/bindings/arm/psci.yaml
@@ -98,6 +98,19 @@ properties:
[1] Kernel documentation - ARM idle states bindings
Documentation/devicetree/bindings/cpu/idle-states.yaml
+ skip-suspend-mode-switch:
+ $ref: /schemas/types.yaml#/definitions/flag
+ description: |
+ Do not issue PSCI_SET_SUSPEND_MODE.
+
+ Some firmware advertises support for OS-initiated mode but rejects
+ every suspend mode switch with NOT_SUPPORTED. Since PSCI cannot report
+ the current mode, the OS cannot verify the state the firmware is in.
+
+ This property is an assertion that the firmware works correctly without
+ a mode switch. This is a workaround for non-compliant firmware, only set
+ it on firmware known to behave this way.
+
patternProperties:
"^power-domain-":
$ref: /schemas/power/power-domain.yaml#
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch
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 16:41 ` Reza Kurniawan
2026-10-17 17:07 ` sashiko-bot
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
3 siblings, 1 reply; 6+ messages in thread
From: Reza Kurniawan @ 2026-10-17 16:41 UTC (permalink / raw)
To: Mark Rutland, Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
Christian Loehle, Bjorn Andersson, Konrad Dybcio, Abel Vesa
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-pm,
linux-arm-msm, Alejandro Tafalla, Reza Kurniawan
From: Alejandro Tafalla <atafalla@dnyon.com>
On some SoCs (e.g. Qualcomm MSM8917 and MSM8937), PSCI reports that OSI
mode is supported but rejects any PSCI_SET_SUSPEND_MODE call with
NOT_SUPPORTED. psci_set_osi_mode() then fails with -EOPNOTSUPP and the
probe is aborted:
psci-cpuidle-domain psci: probe with driver psci-cpuidle-domain failed
with error -95
Add support for the "skip-suspend-mode-switch" property. When present,
do not call psci_set_osi_mode() and continue with the topology that was
already built.
Signed-off-by: Alejandro Tafalla <atafalla@dnyon.com>
[Reza Kurniawan: split out the patch, added log message for skip case, renamed
the property]
Co-developed-by: Reza Kurniawan <imkyufie@gmail.com>
Signed-off-by: Reza Kurniawan <imkyufie@gmail.com>
---
drivers/cpuidle/cpuidle-psci-domain.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/drivers/cpuidle/cpuidle-psci-domain.c b/drivers/cpuidle/cpuidle-psci-domain.c
index 5722365b94..cc9f14769b 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);
+ 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:
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] arm64: dts: qcom: Skip suspend mode switch on MSM8917 and MSM8937
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 16:41 ` [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch Reza Kurniawan
@ 2026-10-17 16:41 ` 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
3 siblings, 0 replies; 6+ messages in thread
From: Reza Kurniawan @ 2026-10-17 16:41 UTC (permalink / raw)
To: Mark Rutland, Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
Christian Loehle, Bjorn Andersson, Konrad Dybcio, Abel Vesa
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-pm,
linux-arm-msm, Reza Kurniawan
The PSCI firmware on Qualcomm MSM8917 and MSM8937 reports to support
OS-initiated suspend mode but rejects call to PSCI_SET_SUSPEND_MODE with
NOT_SUPPORTED. psci_set_osi_mode() then fails with -EOPNOTSUPP and
probe of psci-cpuidle-domain is aborted:
psci-cpuidle-domain psci: probe with driver psci-cpuidle-domain failed
with error -95
Skip the mode switch on these platforms and continue with the topology
that was already built.
This is expected to be safe since it matches the downstream kernel
behavior, which manages the cluster power level in addition to the CPU
power level, just like Linux does when OSI is supported.
Signed-off-by: Reza Kurniawan <imkyufie@gmail.com>
---
arch/arm64/boot/dts/qcom/msm8917.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8937.dtsi | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8917.dtsi b/arch/arm64/boot/dts/qcom/msm8917.dtsi
index a2907f8a63..f0771187d0 100644
--- a/arch/arm64/boot/dts/qcom/msm8917.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8917.dtsi
@@ -182,6 +182,7 @@ pmu {
psci {
compatible = "arm,psci-1.0";
method = "smc";
+ skip-suspend-mode-switch;
cluster_pd: power-domain-cluster {
#power-domain-cells = <0>;
diff --git a/arch/arm64/boot/dts/qcom/msm8937.dtsi b/arch/arm64/boot/dts/qcom/msm8937.dtsi
index 7de6447de4..a66a544f30 100644
--- a/arch/arm64/boot/dts/qcom/msm8937.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8937.dtsi
@@ -311,6 +311,7 @@ pmu {
psci {
compatible = "arm,psci-1.0";
method = "smc";
+ skip-suspend-mode-switch;
};
rpm: remoteproc {
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/4] arm64: dts: qcom: msm8917: Use a shallower cluster state to fix unresponsive idle
2026-10-17 16:41 [PATCH 0/4] Fix PSCI on MSM8917 and MSM8937 Reza Kurniawan
` (2 preceding siblings ...)
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 ` Reza Kurniawan
3 siblings, 0 replies; 6+ messages in thread
From: Reza Kurniawan @ 2026-10-17 16:41 UTC (permalink / raw)
To: Mark Rutland, Lorenzo Pieralisi, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Ulf Hansson, Rafael J. Wysocki, Daniel Lezcano,
Christian Loehle, Bjorn Andersson, Konrad Dybcio, Abel Vesa
Cc: linux-arm-kernel, devicetree, linux-kernel, linux-pm,
linux-arm-msm, Reza Kurniawan
MSM8917 is a single cluster SoC, so powering down the cluster means
powering down the whole system. This causes two problems:
1. The system becomes unresponsive, even to common interrupts. Waking it
requires an interrupt from the MPM (MSM Power Manager) or scheduling
the MPM to wake the system later. Linux currently has no way of doing
the latter, so the cluster may never resume operation.
2. Entering power collapse blanks the screen. When the state is entered
and exited repeatedly, this shows up as visible flicker.
Even if MPM scheduling were implemented, the second problem would remain
and it wouldn't fix the system being unresponsive at idle.
Replace the idle state with PSCI mode 4 (dubbed GDHS downstream), which
is less aggressive and can wake up from conventional interrupt sources.
Signed-off-by: Reza Kurniawan <imkyufie@gmail.com>
---
arch/arm64/boot/dts/qcom/msm8917.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8917.dtsi b/arch/arm64/boot/dts/qcom/msm8917.dtsi
index f0771187d0..7730977e6e 100644
--- a/arch/arm64/boot/dts/qcom/msm8917.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8917.dtsi
@@ -112,10 +112,10 @@ core3 {
domain-idle-states {
cluster_sleep_0: cluster-sleep-0 {
compatible = "domain-idle-state";
- arm,psci-suspend-param = <0x41000053>;
- entry-latency-us = <700>;
- exit-latency-us = <1000>;
- min-residency-us = <6500>;
+ arm,psci-suspend-param = <0x41000043>;
+ entry-latency-us = <240>;
+ exit-latency-us = <280>;
+ min-residency-us = <806>;
};
};
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch
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
0 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-10-17 17:07 UTC (permalink / raw)
To: Reza Kurniawan; +Cc: devicetree, robh, conor+dt
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-17 17:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 16:41 ` [PATCH 2/4] cpuidle: psci: Allow skipping the suspend mode switch Reza Kurniawan
2026-10-17 17:07 ` sashiko-bot
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox