]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core
authorPaul Burton <paulburton@kernel.org>
Wed, 29 Jan 2025 12:32:48 +0000 (13:32 +0100)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 21 Feb 2025 09:19:30 +0000 (10:19 +0100)
commit00a134fc2bb4a5f8fada58cf7ff4259149691d64
tree7b2e931e4c7349a0bb396c622ab7055036bd5b25
parent3128b0a2e0cf6e07aa78e5f8cf7dd9cd59dc8174
MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core

The pm-cps code has up until now used per-CPU variables indexed by core,
rather than CPU number, in order to share data amongst sibling CPUs (ie.
VPs/threads in a core). This works fine for single cluster systems, but
with multi-cluster systems a core number is no longer unique in the
system, leading to sharing between CPUs that are not actually siblings.

Avoid this issue by using per-CPU variables as they are more generally
used - ie. access them using CPU numbers rather than core numbers.
Sharing between siblings is then accomplished by:
 - Assigning the same pointer to entries for each sibling CPU for the
   nc_asm_enter & ready_count variables, which allow this by virtue of
   being per-CPU pointers.

 - Indexing by the first CPU set in a CPUs cpu_sibling_map in the case
   of pm_barrier, for which we can't use the previous approach because
   the per-CPU variable is not a pointer.

Signed-off-by: Paul Burton <paulburton@kernel.org>
Signed-off-by: Dragan Mladjenovic <dragan.mladjenovic@syrmia.com>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
Tested-by: Serge Semin <fancer.lancer@gmail.com>
Tested-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/pm-cps.c