* [PATCH] parisc: Fix crash with nr_cpus=1 option
@ 2023-09-19 13:26 Helge Deller
0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2023-09-19 13:26 UTC (permalink / raw)
To: linux-parisc, John David Anglin
John David Anglin reported that giving "nr_cpus=1" on the command
line causes a crash, while "maxcpus=1" works.
Reported-by: John David Anglin <dave.anglin@bell.net>
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c
index 4098f9a0964b..2019c1f04bd0 100644
--- a/arch/parisc/kernel/smp.c
+++ b/arch/parisc/kernel/smp.c
@@ -440,7 +440,9 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle)
if (cpu_online(cpu))
return 0;
- if (num_online_cpus() < setup_max_cpus && smp_boot_one_cpu(cpu, tidle))
+ if (num_online_cpus() < nr_cpu_ids &&
+ num_online_cpus() < setup_max_cpus &&
+ smp_boot_one_cpu(cpu, tidle))
return -EIO;
return cpu_online(cpu) ? 0 : -EIO;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-09-19 13:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 13:26 [PATCH] parisc: Fix crash with nr_cpus=1 option Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox