Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751792AbcCRBRi (ORCPT ); Thu, 17 Mar 2016 21:17:38 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:57008 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751507AbcCRBR3 (ORCPT ); Thu, 17 Mar 2016 21:17:29 -0400 Date: Thu, 17 Mar 2016 18:17:24 -0700 From: Guenter Roeck To: Qais Yousef Cc: ralf@linux-mips.org, Thomas Gleixner , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: Fix broken malta qemu Message-ID: <20160318011724.GA9717@roeck-us.net> References: <1458248889-24663-1-git-send-email-qsyousef@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458248889-24663-1-git-send-email-qsyousef@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1863 Lines: 49 On Thu, Mar 17, 2016 at 09:08:09PM +0000, Qais Yousef wrote: > Malta defconfig compiles with GIC on. Hence when compiling for SMP it causes the > new IPI code to be activated. But on qemu malta there's no GIC causing a > BUG_ON(!ipidomain) to be hit in mips_smp_ipi_init(). > > Since in that configuration one can only run a single core SMP (!), skip IPI > initialisation if we detect that this is the case. It is a sensible behaviour > to introduce and should keep such possible configuration to run rather than die > hard unnecessarily. > > Signed-off-by: Qais Yousef > Reported-by: Guenter Roeck Tested-by: Guenter Roeck > Cc: Guenter Roeck > Cc: Thomas Gleixner > Cc: linux-mips@linux-mips.org > Cc: linux-kernel@vger.kernel.org > --- > arch/mips/kernel/smp.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c > index 37708d9..27cb638 100644 > --- a/arch/mips/kernel/smp.c > +++ b/arch/mips/kernel/smp.c > @@ -243,6 +243,18 @@ static int __init mips_smp_ipi_init(void) > struct irq_domain *ipidomain; > struct device_node *node; > > + /* > + * In some cases like qemu-malta, it is desired to try SMP with > + * a single core. Qemu-malta has no GIC, so an attempt to set any IPIs > + * would cause a BUG_ON() to be triggered since there's no ipidomain. > + * > + * Since for a single core system IPIs aren't required really, skip the > + * initialisation which should generally keep any such configurations > + * happy and only fail hard when trying to truely run SMP. > + */ > + if (cpumask_weight(cpu_possible_mask) == 1) > + return 0; > + > node = of_irq_find_parent(of_root); > ipidomain = irq_find_matching_host(node, DOMAIN_BUS_IPI); > > -- > 2.7.3 >