MIPS: CPS: Improve mips_cps_first_online_in_cluster()
authorGregory CLEMENT <gregory.clement@bootlin.com>
Fri, 11 Jul 2025 09:54:20 +0000 (11:54 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 16 Jul 2025 16:34:49 +0000 (18:34 +0200)
commitc71085f2c0f18f025784ce975358adcccaa8c041
tree537c0a885f51fb72ef3ca7ef53e30bb35c77ac7c
parent07f8888ee7df5189e64839abb26842dc6c2da371
MIPS: CPS: Improve mips_cps_first_online_in_cluster()

The initial implementation of this function goes through all the CPUs
in a cluster to determine if the current CPU is the only one
running. This process occurs every time the function is called.

However, during boot, we already perform this task, so let's take
advantage of this opportunity to create and fill a CPU bitmask that
can be easily and efficiently used later.

This patch modifies the function to allow providing the first
available online CPU when one already exists, which is necessary for
delay CPU calibration optimization.

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/mips-cps.h
arch/mips/include/asm/smp-cps.h
arch/mips/kernel/mips-cm.c
arch/mips/kernel/smp-cps.c