From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19705E95A91 for ; Mon, 9 Oct 2023 13:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376451AbjJINXg (ORCPT ); Mon, 9 Oct 2023 09:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376443AbjJINXf (ORCPT ); Mon, 9 Oct 2023 09:23:35 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98BF38F for ; Mon, 9 Oct 2023 06:23:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9AE9C433C9; Mon, 9 Oct 2023 13:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1696857814; bh=bS1o+BiUUGetM/YN+sxFGQJ8DIbJZgqQM+lZyFdV1vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KubjsZEA2bjNezEq6jMgCmOFQfXqI8bYER7sy2h9KIL22H/XO3nPc7QA38kuNvNbu b7RZfLpknWK77NktC1QpThEZGhgpnAQ1xQD4/6k5BjZ3TN6MVKDdBF2uMjSXiylrZg n38x1ZyXSnjaeN/PIAPdH4YmxKCXGLNCFXqgrnaY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, John David Anglin , Helge Deller Subject: [PATCH 6.1 138/162] parisc: Fix crash with nr_cpus=1 option Date: Mon, 9 Oct 2023 15:01:59 +0200 Message-ID: <20231009130126.718315265@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231009130122.946357448@linuxfoundation.org> References: <20231009130122.946357448@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Helge Deller commit d3b3c637e4eb8d3bbe53e5692aee66add72f9851 upstream. 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 Signed-off-by: Helge Deller Cc: stable@vger.kernel.org # v5.18+ Signed-off-by: Greg Kroah-Hartman --- arch/parisc/kernel/smp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c @@ -443,7 +443,9 @@ int __cpu_up(unsigned int cpu, struct ta 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;