[PATCH] arm64: versal-net: Add retention state for cpu idle

Michal Simek michal.simek at amd.com
Tue Aug 11 00:23:05 PDT 2026



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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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 at 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






More information about the linux-arm-kernel mailing list