Huacai Chen
807adf6ffa
MIPS: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK
...
commit e1a534f5d074db45ae5cbac41d8912b98e96a006 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-21 15:15:26 +02:00
..
2020-10-18 09:27:10 -07:00
2020-03-25 11:50:48 +01:00
2018-11-09 10:23:19 -08:00
2021-01-19 18:27:20 +01:00
2021-01-19 18:27:20 +01:00
2018-11-08 11:20:57 -08:00
2020-09-21 22:14:24 +02:00
2021-09-26 14:08:59 +02:00
2020-03-05 16:47:35 +01:00
2020-03-05 16:47:35 +01:00
2020-03-05 16:47:35 +01:00
2020-05-22 09:14:32 +02:00
2020-03-05 16:47:35 +01:00
2020-03-05 16:47:35 +01:00
2019-05-30 11:26:32 -07:00
2020-05-22 09:12:52 +02:00
2019-05-30 11:26:32 -07:00
2021-12-01 09:19:07 +01:00
2020-10-12 12:05:16 +02:00
2018-10-31 08:54:16 -07:00
2018-10-31 08:54:16 -07:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2020-05-22 09:14:06 +02:00
2019-05-30 11:26:37 -07:00
2019-05-21 11:28:39 +02:00
2018-07-17 09:40:17 -07:00
2019-05-30 11:26:32 -07:00
2020-05-22 09:09:01 +02:00
2020-10-12 12:04:50 +02:00
2020-10-12 12:04:50 +02:00
2020-08-17 13:00:24 +02:00
2020-07-31 17:52:47 +02:00
2019-06-19 17:09:55 +02:00
2020-09-21 22:15:03 +02:00
2020-03-05 16:47:35 +01:00
2020-11-24 16:47:35 +01:00
2019-05-21 11:28:39 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-02-19 12:45:01 -08:00
2019-04-09 16:21:30 -07:00
2019-03-28 11:35:58 -07:00
2020-09-08 11:52:33 +02:00
2018-08-01 13:20:27 -07:00
2019-06-19 17:09:06 +02:00
2020-10-12 12:05:16 +02:00
2018-06-19 15:00:12 -07:00
2021-11-18 14:04:21 +01:00
2022-06-14 18:32:37 +02:00
2020-09-03 10:13:43 +02:00
2018-11-26 22:49:14 -08:00
2020-05-07 11:55:47 +02:00
2020-06-09 09:39:13 -07:00
2018-06-14 12:21:18 +09:00
2020-09-01 13:52:33 +02:00
2019-06-19 17:09:55 +02:00
2019-10-07 09:42:17 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2022-08-21 15:15:26 +02:00
2020-09-30 21:53:00 +02:00
2020-10-12 12:01:36 +02:00
2020-06-09 09:39:13 -07:00
2020-07-27 14:31:08 -04:00
2020-05-22 09:09:01 +02:00
2018-06-14 12:21:18 +09:00
2019-10-07 09:38:54 -07:00
2021-11-18 14:03:47 +01:00
2018-06-14 12:21:18 +09:00
2019-06-19 17:09:06 +02:00
2021-01-19 18:27:20 +01:00
2018-03-09 11:22:43 +00:00
2020-03-05 16:47:35 +01:00
2018-02-11 14:34:03 -08:00
2019-07-30 10:50:30 -07:00
2019-07-30 10:50:30 -07:00
2019-07-30 10:50:30 -07:00
2020-05-07 13:20:05 +02:00
2019-01-22 11:17:20 -08:00
2020-12-30 11:53:34 +01:00
2019-01-03 18:57:57 -08:00
2019-07-08 21:48:15 -07:00
2019-05-27 09:36:28 -05:00
2020-10-17 15:04:36 -06:00
2020-08-21 09:29:09 +02:00
2019-05-30 11:29:20 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:29:20 -07:00
2022-03-19 13:44:44 +01:00
2019-01-22 11:17:20 -08:00
2020-05-22 09:12:22 +02:00
2019-05-21 10:50:45 +02:00
2020-01-22 10:16:18 -08:00
2021-11-18 14:03:47 +01:00
2020-05-15 14:53:19 +02:00
2022-05-12 12:25:29 +02:00
2020-07-26 10:18:35 +02:00
2022-04-13 21:00:59 +02:00
2020-08-12 10:57:59 -07:00
2019-05-29 13:20:30 -07:00
2020-06-09 09:39:14 -07:00
2021-03-04 11:37:41 +01:00
2020-02-15 12:44:03 -08:00
2020-05-07 11:55:47 +02:00