linux/arch/mips
Paul Burton 2e1b3650f5 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>
History 2025-06-04 14:42:06 +02:00
..
alchemy MIPS: Alchemy: Fix an out-of-bound access in db1550_dev_setup() 2024-01-25 15:35:50 -08:00
ar7 mips: ar7: include linux/gpio/driver.h 2023-03-10 13:40:18 +02:00
ath25 MIPS: ath25: Constify static irq_domain_ops 2022-02-22 09:39:03 +01:00
ath79 MIPS: ath79: remove obsolete ATH79_DEV_* configs 2023-03-17 10:28:04 +01:00
bcm47xx mips: implement the new page table range API 2023-08-24 16:20:22 -07:00
bcm63xx MIPS: BCM63xx: Add check for NULL for clk in clk_enable 2022-12-09 23:37:06 +01:00
bmips mips: bmips: BCM6358: make sure CBR is correctly set 2024-06-27 13:49:05 +02:00
boot MIPS: Loongson64: DTS: Fix msi node for ls7a 2024-12-27 13:58:42 +01:00
cavium-octeon just cleanups and fixes 2023-09-07 10:35:14 -07:00
cobalt MIPS: Remove empty prom_free_prom_memory functions 2021-01-07 17:11:33 +01:00
configs just cleanups and fixes 2023-09-07 10:35:14 -07:00
crypto crypto: Kconfig - simplify cipher entries 2022-08-26 18:50:43 +08:00
dec MIPS: dec: Declare which_prom() as static 2025-04-25 10:45:58 +02:00
fw MIPS: fw: Allow firmware to pass a empty env 2023-04-12 15:07:36 +02:00
generic mips: ingenic: Enable EXT/2 divider on JZ4750/55/60 if EXT is 24 MHz 2023-06-09 09:54:17 +02:00
include MIPS: Use arch specific syscall name match function 2025-06-04 14:42:06 +02:00
ingenic MIPS: Kconfig: ingenic: Ensure MACH_INGENIC_GENERIC selects all SoCs 2021-06-01 11:44:47 +02:00
jazz Revert "change alloc_pages name in dma_map_ops to avoid name conflicts" 2024-09-04 13:28:24 +02:00
kernel MIPS: pm-cps: Use per-CPU variables as per-CPU, not per-core 2025-06-04 14:42:06 +02:00
kvm KVM: MIPS: fix -Wunused-but-set-variable warning 2023-10-12 11:25:40 -04:00
lantiq MIPS: lantiq: register smp_ops on non-smp platforms 2024-01-31 16:19:13 -08:00
lib mips: replace #include <asm/export.h> with #include <linux/export.h> 2023-08-15 10:22:23 +02:00
loongson2ef MIPS: loongson2ef: Add missing break in cs5536_isa 2023-04-12 15:12:24 +02:00
loongson32 MIPS: loongson32: Remove regs-rtc.h 2023-07-28 11:42:16 +02:00
loongson64 MIPS: Loongson64: remove ROM Size unit in boardinfo 2025-02-17 09:40:24 +01:00
math-emu mips/math-emu: fix emulation of the prefx instruction 2025-02-17 09:40:25 +01:00
mm mips: Fix max_mapnr being uninitialized on early stages 2024-01-31 16:18:52 -08:00
mti-malta MIPS: Remove deprecated CONFIG_MIPS_CMP 2023-04-12 15:01:09 +02:00
n64 mips: Add N64 machine type 2021-01-22 11:40:00 +01:00
net Revert "bpf: Take return from set_memory_rox() into account with bpf_jit_binary_lock_ro()" 2024-07-09 11:44:29 +02:00
pci MIPS: Octeron: remove source file executable bit 2024-08-03 08:54:02 +02:00
pic32 MIPS: Fixup explicit DT include clean-up 2023-07-28 11:41:09 +02:00
power mips: check for dsp presence only once before save/restore 2019-10-07 10:58:53 -07:00
ralink MIPS: More explicit DT include clean-ups 2023-07-28 11:41:18 +02:00
rb532 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
sgi-ip22 driver core: make struct bus_type.uevent() take a const * 2023-01-27 13:45:52 +01:00
sgi-ip27 MIPS: SGI-IP27: Fix platform-device leak in bridge_platform_create() 2022-09-19 16:33:27 +02:00
sgi-ip30 MIPS: ip30: ip30-console: Add missing include 2024-08-03 08:54:31 +02:00
sgi-ip32 MIPS: Allow modules to set board_be_handler 2021-11-09 16:07:26 +01:00
sibyte vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
sni vgacon: rework screen_info #ifdef checks 2024-06-27 13:49:15 +02:00
tools MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
txx9 MIPS: TXx9: Do PCI error checks on own line 2023-08-28 09:59:06 +02:00
vdso MIPS: VDSO: Conditionally export __vdso_gettimeofday() 2023-08-23 09:06:38 +02:00
Kbuild kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00
Kbuild.platforms MIPS: sibyte: Remove unused config option SIBYTE_BCM1x55 2023-03-17 10:27:08 +01:00
Kconfig MIPS: Loongson64: Enable DMA noncoherent support 2023-12-13 18:45:35 +01:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile MIPS: Probe toolchain support of -msym32 2025-01-02 10:32:06 +01:00
Makefile.postlink kbuild: remove --include-dir MAKEFLAG from top Makefile 2023-02-05 18:51:22 +09:00