From patchwork Tue Sep 18 08:07:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?5rmb5oyv5rOi?= X-Patchwork-Id: 184652 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id DBB0C2C0081 for ; Tue, 18 Sep 2012 18:15:16 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TDsqY-00029D-OT; Tue, 18 Sep 2012 08:07:54 +0000 Received: from mail-vc0-f177.google.com ([209.85.220.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TDsqV-00027w-DN for linux-arm-kernel@lists.infradead.org; Tue, 18 Sep 2012 08:07:52 +0000 Received: by vcqp16 with SMTP id p16so1935722vcq.36 for ; Tue, 18 Sep 2012 01:07:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=9L+aoglsss0OVCXHc+SuqFw6/Uy7AmV42+6HZropl40=; b=sgiOpipIAQ2BPG+as8O6IFXY8Sj2fsAsyYLUqfyGSFFnZ7fYoCTJnppUr1l5gjtObQ EJ4MKYTK16to4/wQqwn44qk+r6ZbX4YHTqmMLyUxA7ih2jhQWJpFXOizU6LsWKTVuBar WzDAKo7Hotghp1cjHFgJVHlqpBoNvEdzGH3CYRbq9LSODQJA9R6x5ya+a6PfF+KLiFHI Cu47BWFqcrCAl/YHu7wKXRGn53/jgkzZIgtXOql8p/Uez/xTZ3ldEE5ADNPXQfsiBiD9 /7BQZBgUhzk6R8ebWl01WJU32BS+ONs5iLO8Q4jsOAXq/Ut2l2YKRFKJ96jklkLsDXTU KVfA== MIME-Version: 1.0 Received: by 10.220.214.205 with SMTP id hb13mr8935119vcb.28.1347955669901; Tue, 18 Sep 2012 01:07:49 -0700 (PDT) Received: by 10.221.1.84 with HTTP; Tue, 18 Sep 2012 01:07:49 -0700 (PDT) Date: Tue, 18 Sep 2012 16:07:49 +0800 Message-ID: Subject: ARM: smp: why don't eliminate warning "Unknown IPI message 0x1"? From: =?GB2312?B?1b/V8bKo?= To: linux-arm-kernel@lists.infradead.org X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zhanzhenbo[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: rmk+kernel@arm.linux.org.uk, "will.deacon" , santosh.shilimkar@ti.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Russell King want people to move to SGI0 for this, so that we can have SGI1-N as the proper IPIs, but now we can't do this, maybe we must wait for so many years. But, Do you think we can use a another way to resolve this problem, because this warning message will oftenly appeare in products. We can't assume the fixed IPI number that can wakeup secondary cores. "I'd much rather see platforms deciding whether they need to use SGI1 or whether they can switch to SGI0 instead." Just give one ugly idea. I have modify this for example in msm platform. Pls check the attached git diff patch Or below lines and give your suggestions diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index ea73045..8605400 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -495,11 +496,28 @@ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs) handle_IPI(ipinr, regs); } +static int ipi_wakeup_nr[NR_CPUS]; + +void smp_send_wakeup_ipi_begin(unsigned int cpu, unsigned int irq) +{ + ipi_wakeup_nr[cpu] = irq + 1; + gic_raise_softirq(cpumask_of(cpu),irq); +} + +void smp_send_wakeup_ipi_end(unsigned int cpu, unsigned int irq) +{ + BUG_ON(ipi_wakeup_nr[cpu] != irq + 1); + ipi_wakeup_nr[cpu] = 0; +} + void handle_IPI(int ipinr, struct pt_regs *regs) { unsigned int cpu = smp_processor_id(); struct pt_regs *old_regs = set_irq_regs(regs); + if (ipi_wakeup_nr[cpu] == ipinr + 1) + goto Exit; + if (ipinr >= IPI_TIMER && ipinr < IPI_TIMER + NR_IPI) __inc_irq_stat(cpu, ipi_irqs[ipinr - IPI_TIMER]); @@ -537,6 +555,7 @@ void handle_IPI(int ipinr, struct pt_regs *regs) cpu, ipinr); break; } +Exit: set_irq_regs(old_regs); }