Re: [PATCH] cpuidle: warn and fixup on sanity check instead of rejecting the driver

From: Konrad Dybcio

Date: Fri Nov 21 2025 - 09:50:38 EST


On 11/21/25 2:06 AM, Val Packett wrote:
> On Device Tree platforms, the latency and target residency values come
> directly from device trees, which are numerous and weren't all written
> with cpuidle invariants in mind. For example, qcom/hamoa.dtsi currently
> trips this check: exit latency 680000 > residency 600000.
>
> Instead of harshly rejecting the entire cpuidle driver with a mysterious
> error message, print a warning and set the target residency value to be
> equal to the exit latency.
>
> Fixes: 76934e495cdc ("cpuidle: Add sanity check for exit latency and target residency")
> Signed-off-by: Val Packett <val@xxxxxxxxxxxx>
> ---

FWIW this is caused by:

--- hamoa.dtsi
cluster_c4: cpu-sleep-0 {
compatible = "arm,idle-state";
idle-state-name = "ret";
arm,psci-suspend-param = <0x00000004>;
entry-latency-us = <180>;
exit-latency-us = <500>;
min-residency-us = <600>;
};

which notably lacks 'wakeup-latency-us', which triggers this code path:

/*
* If wakeup-latency-us is missing, default to entry+exit
* latencies as defined in idle states bindings
*/
idle_state->exit_latency = entry_latency + exit_latency;

which fails this sanity check because 500+180=680 > 600

(which would have been good to note somewhere)


+Maulik can we fix up the numbers somehow?

Konrad