* [PATCH] arm64: versal-net: Add retention state for cpu idle
@ 2026-07-27 12:18 Jay Buddhabhatti
2026-08-11 7:23 ` Michal Simek
0 siblings, 1 reply; 2+ messages in thread
From: Jay Buddhabhatti @ 2026-07-27 12:18 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, michal.simek
Cc: devicetree, linux-arm-kernel, linux-kernel, git, Jay Buddhabhatti
Remove the sleep state and replace it with a retention state for CPU idle.
The sleep state powers down the CPU core, and the wake-up time cannot be
guaranteed because the firmware may be busy handling other tasks at the time
of the wake-up request. This leads to unpredictable and potentially high
wake-up latency during CPU idle.
Replace the sleep state with a retention state to avoid this dependency on
firmware. The retention state uses a PSCI suspend parameter of 0: the
core simply executes WFI and retains its context without being powered off.
Since wake-up from WFI is handled entirely in hardware, it is effectively
immediate (a few cycles) and does not depend on firmware availability.
As the core is not powered down, the local timer is retained and
"local-timer-stop" is dropped. The entry/exit latency and min-residency
are set to the nominal minimum (1 us), allowing the cpuidle governor to
select the state even for very short idle windows.
Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
---
arch/arm64/boot/dts/xilinx/versal-net.dtsi | 43 +++++++++++-----------
1 file changed, 21 insertions(+), 22 deletions(-)
diff --git a/arch/arm64/boot/dts/xilinx/versal-net.dtsi b/arch/arm64/boot/dts/xilinx/versal-net.dtsi
index 15f767608e67..792bed588ae1 100644
--- a/arch/arm64/boot/dts/xilinx/versal-net.dtsi
+++ b/arch/arm64/boot/dts/xilinx/versal-net.dtsi
@@ -103,7 +103,7 @@ cpu0: cpu@0 {
enable-method = "psci";
reg = <0>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -133,7 +133,7 @@ cpu100: cpu@100 {
enable-method = "psci";
reg = <0x100>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -163,7 +163,7 @@ cpu200: cpu@200 {
enable-method = "psci";
reg = <0x200>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -193,7 +193,7 @@ cpu300: cpu@300 {
enable-method = "psci";
reg = <0x300>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -223,7 +223,7 @@ cpu10000: cpu@10000 {
enable-method = "psci";
reg = <0x10000>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -253,7 +253,7 @@ cpu10100: cpu@10100 {
enable-method = "psci";
reg = <0x10100>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -283,7 +283,7 @@ cpu10200: cpu@10200 {
enable-method = "psci";
reg = <0x10200>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -313,7 +313,7 @@ cpu10300: cpu@10300 {
enable-method = "psci";
reg = <0x10300>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -343,7 +343,7 @@ cpu20000: cpu@20000 {
enable-method = "psci";
reg = <0x20000>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -373,7 +373,7 @@ cpu20100: cpu@20100 {
enable-method = "psci";
reg = <0x20100>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -403,7 +403,7 @@ cpu20200: cpu@20200 {
enable-method = "psci";
reg = <0x20200>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -433,7 +433,7 @@ cpu20300: cpu@20300 {
enable-method = "psci";
reg = <0x20300>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -463,7 +463,7 @@ cpu30000: cpu@30000 {
enable-method = "psci";
reg = <0x30000>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -493,7 +493,7 @@ cpu30100: cpu@30100 {
enable-method = "psci";
reg = <0x30100>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -523,7 +523,7 @@ cpu30200: cpu@30200 {
enable-method = "psci";
reg = <0x30200>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -553,7 +553,7 @@ cpu30300: cpu@30300 {
enable-method = "psci";
reg = <0x30300>;
operating-points-v2 = <&cpu_opp_table>;
- cpu-idle-states = <&CPU_SLEEP_0>;
+ cpu-idle-states = <&CPU_RETENTION_0>;
d-cache-size = <0x10000>; /* 64kB */
d-cache-line-size = <64>;
/* 4 ways set associativity */
@@ -636,13 +636,12 @@ llc: l4-cache { /* LLC inside CMN */
idle-states {
entry-method = "psci";
- CPU_SLEEP_0: cpu-sleep-0 {
+ CPU_RETENTION_0: cpu-retention-0 {
compatible = "arm,idle-state";
- arm,psci-suspend-param = <0x40000000>;
- local-timer-stop;
- entry-latency-us = <300>;
- exit-latency-us = <600>;
- min-residency-us = <10000>;
+ arm,psci-suspend-param = <0>;
+ entry-latency-us = <1>;
+ exit-latency-us = <1>;
+ min-residency-us = <1>;
};
};
};
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] arm64: versal-net: Add retention state for cpu idle
2026-07-27 12:18 [PATCH] arm64: versal-net: Add retention state for cpu idle Jay Buddhabhatti
@ 2026-08-11 7:23 ` Michal Simek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Simek @ 2026-08-11 7:23 UTC (permalink / raw)
To: Jay Buddhabhatti, robh, krzk+dt, conor+dt
Cc: devicetree, linux-arm-kernel, linux-kernel, git
On 7/27/26 14:18, Jay Buddhabhatti wrote:
> Remove the sleep state and replace it with a retention state for CPU idle.
> The sleep state powers down the CPU core, and the wake-up time cannot be
> guaranteed because the firmware may be busy handling other tasks at the time
> of the wake-up request. This leads to unpredictable and potentially high
> wake-up latency during CPU idle.
>
> Replace the sleep state with a retention state to avoid this dependency on
> firmware. The retention state uses a PSCI suspend parameter of 0: the
> core simply executes WFI and retains its context without being powered off.
> Since wake-up from WFI is handled entirely in hardware, it is effectively
> immediate (a few cycles) and does not depend on firmware availability.
>
> As the core is not powered down, the local timer is retained and
> "local-timer-stop" is dropped. The entry/exit latency and min-residency
> are set to the nominal minimum (1 us), allowing the cpuidle governor to
> select the state even for very short idle windows.
>
> Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti@amd.com>
> ---
> arch/arm64/boot/dts/xilinx/versal-net.dtsi | 43 +++++++++++-----------
> 1 file changed, 21 insertions(+), 22 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/xilinx/versal-net.dtsi b/arch/arm64/boot/dts/xilinx/versal-net.dtsi
> index 15f767608e67..792bed588ae1 100644
> --- a/arch/arm64/boot/dts/xilinx/versal-net.dtsi
> +++ b/arch/arm64/boot/dts/xilinx/versal-net.dtsi
> @@ -103,7 +103,7 @@ cpu0: cpu@0 {
> enable-method = "psci";
> reg = <0>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -133,7 +133,7 @@ cpu100: cpu@100 {
> enable-method = "psci";
> reg = <0x100>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -163,7 +163,7 @@ cpu200: cpu@200 {
> enable-method = "psci";
> reg = <0x200>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -193,7 +193,7 @@ cpu300: cpu@300 {
> enable-method = "psci";
> reg = <0x300>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -223,7 +223,7 @@ cpu10000: cpu@10000 {
> enable-method = "psci";
> reg = <0x10000>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -253,7 +253,7 @@ cpu10100: cpu@10100 {
> enable-method = "psci";
> reg = <0x10100>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -283,7 +283,7 @@ cpu10200: cpu@10200 {
> enable-method = "psci";
> reg = <0x10200>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -313,7 +313,7 @@ cpu10300: cpu@10300 {
> enable-method = "psci";
> reg = <0x10300>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -343,7 +343,7 @@ cpu20000: cpu@20000 {
> enable-method = "psci";
> reg = <0x20000>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -373,7 +373,7 @@ cpu20100: cpu@20100 {
> enable-method = "psci";
> reg = <0x20100>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -403,7 +403,7 @@ cpu20200: cpu@20200 {
> enable-method = "psci";
> reg = <0x20200>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -433,7 +433,7 @@ cpu20300: cpu@20300 {
> enable-method = "psci";
> reg = <0x20300>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -463,7 +463,7 @@ cpu30000: cpu@30000 {
> enable-method = "psci";
> reg = <0x30000>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -493,7 +493,7 @@ cpu30100: cpu@30100 {
> enable-method = "psci";
> reg = <0x30100>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -523,7 +523,7 @@ cpu30200: cpu@30200 {
> enable-method = "psci";
> reg = <0x30200>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -553,7 +553,7 @@ cpu30300: cpu@30300 {
> enable-method = "psci";
> reg = <0x30300>;
> operating-points-v2 = <&cpu_opp_table>;
> - cpu-idle-states = <&CPU_SLEEP_0>;
> + cpu-idle-states = <&CPU_RETENTION_0>;
> d-cache-size = <0x10000>; /* 64kB */
> d-cache-line-size = <64>;
> /* 4 ways set associativity */
> @@ -636,13 +636,12 @@ llc: l4-cache { /* LLC inside CMN */
> idle-states {
> entry-method = "psci";
>
> - CPU_SLEEP_0: cpu-sleep-0 {
> + CPU_RETENTION_0: cpu-retention-0 {
> compatible = "arm,idle-state";
> - arm,psci-suspend-param = <0x40000000>;
> - local-timer-stop;
> - entry-latency-us = <300>;
> - exit-latency-us = <600>;
> - min-residency-us = <10000>;
> + arm,psci-suspend-param = <0>;
> + entry-latency-us = <1>;
> + exit-latency-us = <1>;
> + min-residency-us = <1>;
> };
> };
> };
This patch should likely changed because default cpuidle-psci creates wfi
backend automatically when no DT idle states are detected. Jay is looking into it.
Thanks,
Michal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-11 7:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-27 12:18 [PATCH] arm64: versal-net: Add retention state for cpu idle Jay Buddhabhatti
2026-08-11 7:23 ` Michal Simek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox