From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760240AbcKDJ3K (ORCPT ); Fri, 4 Nov 2016 05:29:10 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:45845 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759980AbcKDJ3I (ORCPT ); Fri, 4 Nov 2016 05:29:08 -0400 From: Matt Redfearn To: Ralf Baechle , CC: Matt Redfearn , Masahiro Yamada , , James Hogan , Paul Burton , Qais Yousef , Andrew Morton Subject: [PATCH 3/3] MIPS: smp-cps: Don't BUG if a CPU fails to start Date: Fri, 4 Nov 2016 09:28:58 +0000 Message-ID: <1478251738-13593-4-git-send-email-matt.redfearn@imgtec.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478251738-13593-1-git-send-email-matt.redfearn@imgtec.com> References: <1478251738-13593-1-git-send-email-matt.redfearn@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.150.130.83] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If there is no online CPU within a core which could receive the IPI to start another VP in that core, a BUG() is triggered. Instead print a warning and gracefully handle the failure such that the system remains usable, albeit without the requested secondary CPU. Signed-off-by: Matt Redfearn --- arch/mips/kernel/smp-cps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c index 44339b470ef4..a2544c2394e4 100644 --- a/arch/mips/kernel/smp-cps.c +++ b/arch/mips/kernel/smp-cps.c @@ -326,7 +326,11 @@ static void cps_boot_secondary(int cpu, struct task_struct *idle) if (cpu_online(remote)) break; } - BUG_ON(remote >= NR_CPUS); + if (remote >= NR_CPUS) { + pr_crit("No online CPU in core %u to start CPU%d\n", + core, cpu); + goto out; + } err = smp_call_function_single(remote, remote_vpe_boot, NULL, 1); -- 2.7.4