[PATCH v2] cpuidle: psci: Skip Gaokun3 cluster power-down in s2idle

From: Lee Youngjoon

Date: Fri Nov 27 2026 - 05:57:16 EST


The Huawei MateBook E Go (Gaokun3) fails to resume from s2idle when
the SC8280XP cluster idle state (0x4100c344) is available. Keep the
cluster idle state in the Device Tree so its runtime idle governor
and the RPMh next-wakeup lookup retain the existing configuration.

For the Gaokun3 cluster domain, wrap the system power-down decision
and reject the cluster transition during s2idle. Leave the runtime
power-down callback and per-CPU idle states intact.

On a GK-W7X running firmware 2.18, the candidate booted with the
original cluster idle state in DT and resumed in the same boot after
159 seconds of s2idle using the power button and no RTC alarm. The
cluster genpd counters showed 510 runtime uses and zero s2idle uses.
The test kernel also carried a separate RPMh KTIME_MAX guard.

Link: https://lore.kernel.org/r/CA+m4KrB1p2u_y92phm-xpn3up=kebi1OmiVc3X4CCdFzHT9-5Q@xxxxxxxxxxxxxx
Signed-off-by: Lee Youngjoon <getfeus@xxxxxxxxx>
---
Changes in v2:
- Keep the DT state and runtime governor in place.
- Limit the workaround to the system governor's s2idle decision.

--- a/drivers/cpuidle/cpuidle-psci-domain.c
+++ b/drivers/cpuidle/cpuidle-psci-domain.c
@@ -9,6 +9,7 @@

#define pr_fmt(fmt) "CPUidle PSCI: " fmt

+#include <linux/suspend.h>
#include <linux/cpu.h>
#include <linux/device.h>
#include <linux/kernel.h>
@@ -41,6 +42,20 @@
return 0;
}

+/*
+ * The Gaokun3 cluster state fails to resume from s2idle. Keep the
+ * normal governor for runtime idle and reject only s2idle power-down.
+ */
+static bool gaokun3_cluster_system_power_down_ok(struct dev_pm_domain *pd)
+{
+ if (pm_suspend_target_state == PM_SUSPEND_TO_IDLE)
+ return false;
+
+ return pm_domain_cpu_gov.system_power_down_ok(pd);
+}
+
+static struct dev_power_governor gaokun3_cluster_gov;
+
static int psci_pd_init(struct device_node *np, bool use_osi)
{
struct generic_pm_domain *pd;
@@ -71,6 +86,13 @@

/* Use governor for CPU PM domains if it has some states to manage. */
pd_gov = pd->states ? &pm_domain_cpu_gov : NULL;
+ if (pd_gov && of_machine_is_compatible("huawei,gaokun3") &&
+ of_node_name_eq(np, "power-domain-cpu-cluster0")) {
+ gaokun3_cluster_gov = pm_domain_cpu_gov;
+ gaokun3_cluster_gov.system_power_down_ok =
+ gaokun3_cluster_system_power_down_ok;
+ pd_gov = &gaokun3_cluster_gov;
+ }

ret = pm_genpd_init(pd, pd_gov, use_osi);
if (ret)