linux/arch/mips
Huacai Chen e1a534f5d0 MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
When CONFIG_CPUMASK_OFFSTACK and CONFIG_DEBUG_PER_CPU_MAPS is selected,
cpu_max_bits_warn() generates a runtime warning similar as below while
we show /proc/cpuinfo. Fix this by using nr_cpu_ids (the runtime limit)
instead of NR_CPUS to iterate CPUs.

[    3.052463] ------------[ cut here ]------------
[    3.059679] WARNING: CPU: 3 PID: 1 at include/linux/cpumask.h:108 show_cpuinfo+0x5e8/0x5f0
[    3.070072] Modules linked in: efivarfs autofs4
[    3.076257] CPU: 0 PID: 1 Comm: systemd Not tainted 5.19-rc5+ #1052
[    3.084034] Hardware name: Loongson Loongson-3A4000-7A1000-1w-V0.1-CRB/Loongson-LS3A4000-7A1000-1w-EVB-V1.21, BIOS Loongson-UDK2018-V2.0.04082-beta7 04/27
[    3.099465] Stack : 9000000100157b08 9000000000f18530 9000000000cf846c 9000000100154000
[    3.109127]         9000000100157a50 0000000000000000 9000000100157a58 9000000000ef7430
[    3.118774]         90000001001578e8 0000000000000040 0000000000000020 ffffffffffffffff
[    3.128412]         0000000000aaaaaa 1ab25f00eec96a37 900000010021de80 900000000101c890
[    3.138056]         0000000000000000 0000000000000000 0000000000000000 0000000000aaaaaa
[    3.147711]         ffff8000339dc220 0000000000000001 0000000006ab4000 0000000000000000
[    3.157364]         900000000101c998 0000000000000004 9000000000ef7430 0000000000000000
[    3.167012]         0000000000000009 000000000000006c 0000000000000000 0000000000000000
[    3.176641]         9000000000d3de08 9000000001639390 90000000002086d8 00007ffff0080286
[    3.186260]         00000000000000b0 0000000000000004 0000000000000000 0000000000071c1c
[    3.195868]         ...
[    3.199917] Call Trace:
[    3.203941] [<98000000002086d8>] show_stack+0x38/0x14c
[    3.210666] [<9800000000cf846c>] dump_stack_lvl+0x60/0x88
[    3.217625] [<980000000023d268>] __warn+0xd0/0x100
[    3.223958] [<9800000000cf3c90>] warn_slowpath_fmt+0x7c/0xcc
[    3.231150] [<9800000000210220>] show_cpuinfo+0x5e8/0x5f0
[    3.238080] [<98000000004f578c>] seq_read_iter+0x354/0x4b4
[    3.245098] [<98000000004c2e90>] new_sync_read+0x17c/0x1c4
[    3.252114] [<98000000004c5174>] vfs_read+0x138/0x1d0
[    3.258694] [<98000000004c55f8>] ksys_read+0x70/0x100
[    3.265265] [<9800000000cfde9c>] do_syscall+0x7c/0x94
[    3.271820] [<9800000000202fe4>] handle_syscall+0xc4/0x160
[    3.281824] ---[ end trace 8b484262b4b8c24c ]---

Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2022-07-14 11:49:40 +02:00
..
alchemy MIPS: Alchemy: devboards: Remove duplicate 'the' in two places. 2022-07-05 11:11:36 +02:00
ar7 mips: ar7: convert to CONFIG_COMMON_CLK 2021-06-08 17:00:09 +02:00
ath25 MIPS: ath25: Constify static irq_domain_ops 2022-02-22 09:39:03 +01:00
ath79 MIPS: Remove redundant definitions of device_tree_init() 2022-03-14 15:09:02 +01:00
bcm47xx MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 2022-01-09 15:41:50 +01:00
bcm63xx linux-watchdog 5.17-rc1 tag 2022-01-17 08:07:57 +02:00
bmips MIPS: bmips: Fix compiler warning observed on W=1 build 2022-05-23 18:28:03 +02:00
boot MIPS: mscc: ocelot: enable FDMA usage 2022-07-05 11:12:30 +02:00
cavium-octeon mips: cavium-octeon: Fix missing of_node_put() in octeon2_usb_clocks_start 2022-07-05 11:16:03 +02:00
cobalt
configs Cleanups and fixes 2022-05-30 11:01:50 -07:00
crypto MIPS: crypto: Fix CRC32 code 2022-04-01 10:19:03 +02:00
dec MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
fw MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
generic arch: mips: generic: Add missing of_node_put() in board-ranchu.c 2022-06-21 17:04:30 +02:00
include MIPS: Make phys_to_virt utilize __va() 2022-07-11 10:33:18 +02:00
ingenic MIPS: Kconfig: ingenic: Ensure MACH_INGENIC_GENERIC selects all SoCs 2021-06-01 11:44:47 +02:00
jazz MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
kernel MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-07-14 11:49:40 +02:00
kvm MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
lantiq mips: lantiq: Add missing of_node_put() in irq.c 2022-06-21 22:34:03 +02:00
lib MIPS: Only use current_stack_pointer on GCC 2022-03-14 15:02:53 +01:00
loongson2ef MIPS: Loongson{2ef,64}: Wrap -mno-branch-likely with cc-option 2022-02-07 18:30:12 +01:00
loongson32 MIPS: loongson32: Kconfig: Remove extra space 2022-05-23 11:08:45 +02:00
loongson64 MIPS: Loongson64: Fix section mismatch warning 2022-07-05 11:20:52 +02:00
math-emu MIPS: math-emu: Use the bitmap API to allocate bitmaps 2022-07-11 10:27:50 +02:00
mm MIPS: mm: Use the bitmap API to allocate bitmaps 2022-07-11 10:28:12 +02:00
mti-malta mips: mti-malta: Fix refcount leak in malta-time.c 2022-06-21 17:04:30 +02:00
n64
net MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
pci MIPS: PCI: Remove leading space in info message, rename pci 2022-07-05 11:10:34 +02:00
pic32 mips/pic32/pic32mzda: Fix refcount leak bugs 2022-06-21 17:04:54 +02:00
power
ralink mips: ralink: Fix refcount leak in of.c 2022-06-21 17:04:30 +02:00
rb532 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
sgi-ip22 mips: sgi-ip22: Drop redundant check from .remove() 2022-07-05 11:10:17 +02:00
sgi-ip27 MIPS: SGI-IP27: Free some unused memory 2022-04-26 15:06:00 +02:00
sgi-ip30 MIPS: SGI-IP30: Free some unused memory 2022-04-26 15:07:23 +02:00
sgi-ip32 MIPS: Allow modules to set board_be_handler 2021-11-09 16:07:26 +01:00
sibyte Cleanups and fixes 2022-05-30 11:01:50 -07:00
sni MIPS: sni: Fix the build 2021-10-18 18:09:54 +02:00
tools MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
txx9 MIPS: fix typos in comments 2022-05-04 22:22:59 +02:00
vdso mips: Enable KCSAN 2022-02-07 18:31:57 +01:00
vr41xx MIPS: Remove repetitive increase irq_err_count 2022-06-21 16:50:58 +02:00
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kbuild.platforms MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
Kconfig RISC-V Patches for the 5.19 Merge Window, Part 1 2022-05-31 14:10:54 -07:00
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile mips: Always permit to build u-boot images 2022-03-07 13:11:20 +01:00
Makefile.postlink