linux-yocto/arch/mips/kernel
Paul Burton 3972bd4ca5 MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core
[ Upstream commit 00a134fc2b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-06-04 14:40:12 +02:00
..
syscalls mips: fix compat_sys_lseek syscall 2024-07-25 09:49:13 +02:00
.gitignore
access-helper.h
asm-offsets.c MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:56:07 +02:00
bmips_5xxx_init.S
bmips_vec.S
branch.c
cacheinfo.c
cevt-bcm1480.c
cevt-ds1287.c MIPS: cevt-ds1287: Add missing ds1287.h include 2025-04-25 10:44:04 +02:00
cevt-gt641xx.c
cevt-r4k.c MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed 2024-09-12 11:10:25 +02:00
cevt-sb1250.c
cevt-txx9.c
cmpxchg.c MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
cps-vec-ns16550.S
cps-vec.S
cpu-probe.c MIPS: Loongson64: Set timer mode in cpu-probe 2024-08-29 17:30:49 +02:00
cpu-r3k-probe.c MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
crash_dump.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
crash.c
csrc-bcm1480.c
csrc-ioasic.c
csrc-r4k.c
csrc-sb1250.c
early_printk_8250.c
early_printk.c
elf.c mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan 2024-01-31 16:17:12 -08:00
entry.S MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
fpu-probe.c
fpu-probe.h
ftrace.c MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static 2025-02-21 13:49:54 +01:00
genex.S MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
gpio_txx9.c
head.S
i8253.c
idle.c MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
irq_txx9.c MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
irq-gt641xx.c
irq-msc01.c
irq.c MIPS: Only use current_stack_pointer on GCC 2022-03-14 15:02:53 +01:00
jump_label.c MIPS: jump_label: Fix compat branch range check 2022-11-11 15:46:03 +01:00
kgdb.c
kprobes.c MIPS: Use NOKPROBE_SYMBOL() instead of __kprobes annotation 2022-05-12 18:00:51 +02:00
linux32.c
machine_kexec.c
Makefile kbuild: use obj-y instead extra-y for objects placed at the head 2022-10-02 18:04:05 +09:00
mcount.S
mips-cm.c MIPS: cm: Detect CM quirks from device tree 2025-05-02 07:47:01 +02:00
mips-cpc.c mips: cpc: Fix refcount leak in mips_cpc_default_phys_base 2022-04-26 15:11:25 +02:00
mips-mt-fpaff.c
mips-mt.c mips: rename mt_init to mips_mt_init 2022-07-29 18:07:13 -07:00
mips-r2-to-r6-emul.c MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
module.c jump_label: mips: move module NOP patching into arch code 2022-06-24 09:48:55 +02:00
octeon_switch.S
perf_event_mipsxx.c MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
perf_event.c
perf_regs.c
pm-cps.c MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core 2025-06-04 14:40:12 +02:00
pm.c
probes-common.h
proc.c MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-07-14 11:49:40 +02:00
process.c MIPS: kernel: Clear FPU states when setting up kernel threads 2023-12-13 18:39:28 +01:00
prom.c MIPS: move from strlcpy with unused retval to strscpy 2022-09-12 15:34:04 +02:00
ptrace.c ptrace: Introduce exception_ip arch hook 2025-03-07 16:56:51 +01:00
ptrace32.c
r4k_fpu.S MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
r4k_switch.S
r4k-bugs64.c MIPS: remove asm/war.h 2022-02-22 09:35:49 +01:00
r2300_fpu.S MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
r2300_switch.S
relocate_kernel.S MIPS: fix duplicate definitions for exported symbols 2022-11-11 15:44:44 +01:00
relocate.c MIPS: move from strlcpy with unused retval to strscpy 2022-09-12 15:34:04 +02:00
reset.c mips: Use do_kernel_power_off() 2022-05-19 19:30:31 +02:00
rtlx-cmp.c
rtlx-mt.c
rtlx.c
scall32-o32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:56:07 +02:00
scall64-n32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:56:07 +02:00
scall64-n64.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:56:07 +02:00
scall64-o32.S MIPS: scall: Save thread_info.syscall unconditionally on entry 2024-05-17 11:56:07 +02:00
segment.c mips: kernel: convert to DEFINE_SHOW_ATTRIBUTE 2022-09-19 16:40:17 +02:00
setup.c mips: Fix incorrect max_low_pfn adjustment 2024-01-25 15:27:45 -08:00
signal_n32.c MIPS: remove asm/war.h 2022-02-22 09:35:49 +01:00
signal_o32.c
signal-common.h
signal.c ptrace: Cleanups for v5.18 2022-03-28 17:29:53 -07:00
signal32.c
smp-bmips.c MIPS: BMIPS: Remove use of irq_cpu_offline 2021-10-20 20:06:32 +01:00
smp-cmp.c
smp-cps.c MIPS: SMP-CPS: Fix address for GCR_ACCESS register for CM3 and later 2024-08-03 08:49:49 +02:00
smp-mt.c
smp-up.c
smp.c mips/smp: Call rcutree_report_cpu_starting() earlier 2024-01-25 15:27:39 -08:00
spinlock_test.c
spram.c
stacktrace.c
sync-r4k.c
syscall.c MIPS: Fix build error due to PTR used in more places 2022-01-27 09:04:19 +01:00
sysrq.c
time.c MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-04-29 15:52:00 +02:00
topology.c drivers/base/node: consolidate node device subsystem initialization in node_dev_init() 2022-03-22 15:57:10 -07:00
traps.c MIPS: reserve exception vector space ONLY ONCE 2024-03-01 13:26:26 +01:00
unaligned.c MIPS: Handle address errors for accesses above CPU max virtual user address 2022-02-25 09:36:05 +01:00
uprobes.c MIPS: Fix fall-through warnings for Clang 2021-10-13 14:47:42 -05:00
vdso.c treewide: use prandom_u32_max() when possible, part 1 2022-10-11 17:42:55 -06:00
vmlinux.lds.S MIPS: Define RUNTIME_DISCARD_EXIT in LD script 2023-04-26 14:28:42 +02:00
vpe-cmp.c MIPS: vpe-cmp: fix possible memory leak while module exiting 2022-12-31 13:31:56 +01:00
vpe-mt.c MIPS: vpe-mt: fix possible memory leak while module exiting 2022-12-31 13:31:56 +01:00
vpe.c
watch.c