Huacai Chen
4cb392956a
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-25 11:14:56 +02:00
..
2018-06-14 12:21:18 +09:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2016-05-09 12:00:01 +02:00
2016-05-09 12:00:01 +02:00
2018-01-18 22:29:02 +00:00
2021-09-26 13:39:48 +02:00
2017-04-14 13:11:16 -07:00
2017-04-14 13:11:16 -07:00
2017-04-14 13:11:16 -07:00
2017-04-10 13:31:12 +02:00
2017-04-14 13:11:16 -07:00
2017-04-14 13:11:16 -07:00
2019-03-05 17:58:53 +01:00
2017-11-03 09:02:30 -07:00
2018-02-05 11:53:06 +00:00
2017-01-24 18:30:34 +01:00
2019-10-17 13:45:32 -07:00
2017-11-02 11:10:55 +01:00
2018-11-21 09:19:10 +01:00
2016-12-25 11:04:12 +01:00
2016-12-25 11:04:12 +01:00
2016-12-25 11:04:12 +01:00
2016-12-25 11:04:12 +01:00
2018-07-17 09:40:17 -07:00
2018-07-17 09:40:17 -07:00
2017-11-03 09:02:30 -07:00
2018-06-19 21:13:56 -07:00
2018-12-05 19:32:10 +01:00
2020-06-22 09:05:19 +02:00
2016-02-19 09:51:44 +01:00
2017-06-27 23:35:21 +02:00
2019-08-29 08:28:27 +02:00
2018-06-28 14:18:54 -07:00
2019-03-10 07:17:20 +01:00
2019-06-04 08:02:34 +02:00
2019-05-10 17:54:07 +02:00
2018-06-21 12:33:19 +02:00
2018-08-01 13:20:27 -07:00
2018-11-21 09:19:10 +01:00
2017-11-02 11:10:55 +01:00
2018-06-19 15:00:12 -07:00
2021-11-26 11:36:14 +01:00
2022-06-14 16:59:34 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-08-29 15:21:55 +02:00
2017-07-15 10:59:54 -07:00
2018-06-14 12:21:18 +09:00
2019-05-25 18:23:33 +02:00
2017-03-02 08:42:36 +01:00
2018-03-09 13:53:26 +00:00
2016-05-09 12:00:02 +02:00
2017-11-02 10:58:43 +00:00
2022-08-25 11:14:56 +02:00
2019-03-13 14:02:37 -07:00
2019-06-15 11:54:05 +02:00
2018-07-19 13:47:21 -07:00
2018-07-19 13:58:44 -07:00
2017-11-09 14:13:40 +00:00
2018-06-14 12:21:18 +09:00
2021-11-26 11:36:02 +01:00
2018-06-14 12:21:18 +09:00
2018-06-24 09:26:01 -07:00
2021-01-19 18:22:35 +01:00
2018-03-09 11:22:43 +00:00
2018-02-11 14:34:03 -08:00
2018-06-19 21:14:29 -07:00
2018-06-19 21:14:29 -07:00
2018-06-19 21:14:29 -07:00
2019-05-02 09:58:53 +02:00
2016-07-28 11:44:30 +02:00
2020-06-22 09:05:13 +02:00
2018-04-19 13:29:54 +02:00
2018-08-01 13:20:15 -07:00
2018-08-01 13:20:15 -07:00
2018-08-13 19:24:32 -07:00
2020-09-09 19:04:24 +02:00
2017-11-01 23:23:00 +00:00
2018-02-05 14:36:06 +00:00
2017-09-04 13:53:14 +02:00
2017-08-30 00:57:27 +02:00
2022-03-23 09:10:41 +01:00
2017-11-02 11:10:55 +01:00
2016-05-13 14:01:52 +02:00
2017-03-02 08:42:36 +01:00
2017-11-02 11:10:55 +01:00
2021-11-26 11:36:02 +01:00
2017-11-02 11:10:55 +01:00
2022-05-12 12:20:23 +02:00
2020-08-21 11:05:32 +02:00
2022-04-15 14:15:02 +02:00
2017-08-29 15:21:55 +02:00
2019-06-25 11:35:56 +08:00
2019-01-09 17:38:47 +01:00
2021-03-04 09:39:31 +01:00
2020-03-05 16:42:19 +01:00
2018-01-23 15:46:01 +00:00