From 41297ecf6e340b6796c75c8f6d54b19a4304b8d0 Mon Sep 17 00:00:00 2001 From: Liang Chen Date: Thu, 3 Nov 2022 17:20:26 +0800 Subject: [PATCH] soc: rockchip: rockchip_performance: correct cpub_mask for rk3588 The max frequency of A76 is 2.2GHz to 2.4GHz for rk3588, so make sure all A76 is added to cpub_mask if the frequency is less than 2.4G. Change-Id: I7d2e4a607acb127aafe385acc2840bdc6489d961 Signed-off-by: Liang Chen --- drivers/soc/rockchip/rockchip_performance.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/soc/rockchip/rockchip_performance.c b/drivers/soc/rockchip/rockchip_performance.c index e8df14647b47..13d077548167 100644 --- a/drivers/soc/rockchip/rockchip_performance.c +++ b/drivers/soc/rockchip/rockchip_performance.c @@ -98,6 +98,7 @@ module_param_cb(level, &level_param_ops, &perf_level, 0644); static __init int rockchip_perf_init(void) { int cpu; + int cpub_min_cap = SCHED_CAPACITY_SCALE - (SCHED_CAPACITY_SCALE >> 3); if (!zalloc_cpumask_var(&cpul_mask, GFP_KERNEL)) return -ENOMEM; @@ -105,7 +106,7 @@ static __init int rockchip_perf_init(void) return -ENOMEM; for_each_possible_cpu(cpu) { - if (arch_scale_cpu_capacity(cpu) == SCHED_CAPACITY_SCALE) + if (arch_scale_cpu_capacity(cpu) > cpub_min_cap) cpumask_set_cpu(cpu, cpub_mask); else cpumask_set_cpu(cpu, cpul_mask);