From d65f2b5727b733cc02493b07e6bdcb2d0ec3d5aa Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Wed, 11 Nov 2026 19:15:42 -0500 Subject: [PATCH] pmdomain: apple: pmp-report: Read CPU idle time without cpufreq The J613 floor samples each CPU's idle time with get_cpu_idle_time(), which cpufreq.h declares only with CONFIG_CPU_FREQ. Without it, as in the arm64 KUnit configs, the call is an implicit declaration and the driver fails to build. Read the two counters that get_cpu_idle_time(cpu, &wall, 0) adds, idle and iowait, from kernel_stat.h, which declares them for every config. The order is the same, so the wall time still comes from the iowait read. Signed-off-by: Diljit Singh --- drivers/pmdomain/apple/pmp-report.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pmdomain/apple/pmp-report.c b/drivers/pmdomain/apple/pmp-report.c index e1c97e41bf25d..a83fbc98d56e3 100644 --- a/drivers/pmdomain/apple/pmp-report.c +++ b/drivers/pmdomain/apple/pmp-report.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -1701,7 +1702,10 @@ static void j613_floor_sample_cpus(struct j613_floor *f, u64 period, if (!cpu_online(cpu)) f->cpu_wall[cpu] = 0; for_each_online_cpu(cpu) { - u64 wall, idle = get_cpu_idle_time(cpu, &wall, 0); + u64 wall, idle = get_cpu_idle_time_us(cpu, NULL); + + /* As get_cpu_idle_time(cpu, &wall, 0), which needs CONFIG_CPU_FREQ */ + idle += get_cpu_iowait_time_us(cpu, &wall); /* A CPU unseen for many periods (hotplug, long delay) is skipped once. */ if (f->primed && f->cpu_wall[cpu] && wall > f->cpu_wall[cpu] &&