From patchwork Fri Dec 9 09:59:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuriy Kolerov X-Patchwork-Id: 704385 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tZnlq3hXyz9vFT for ; Fri, 9 Dec 2016 21:00:07 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cFHyH-0003jn-Tk; Fri, 09 Dec 2016 10:00:05 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cFHyF-0003Rg-N2 for linux-snps-arc@lists.infradead.org; Fri, 09 Dec 2016 10:00:04 +0000 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id B15D724E15B4; Fri, 9 Dec 2016 01:59:42 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 1E8FE4CF; Fri, 9 Dec 2016 01:59:42 -0800 (PST) Received: from ykolerov-vm.internal.synopsys.com (unknown [10.121.8.21]) by mailhost.synopsys.com (Postfix) with ESMTP id 80ED94CC; Fri, 9 Dec 2016 01:59:40 -0800 (PST) From: Yuriy Kolerov To: linux-snps-arc@lists.infradead.org Subject: [PATCH v2 1/2] ARC: SMP: Set the default affinity to the boot cpu Date: Fri, 9 Dec 2016 12:59:31 +0300 Message-Id: <1481277572-18283-1-git-send-email-yuriy.kolerov@synopsys.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161209_020003_851180_B9BEE184 X-CRM114-Status: UNSURE ( 8.13 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -3.3 (---) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-3.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.47.9 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.47.9 listed in list.dnswl.org] -1.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, Yuriy Kolerov MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org By default the kernel sets a value for default affinity which may not correspond to the real bitmap of potentially online CPUs. E.g. for ARC HS processors with 2 cores the default value of affinity in the kernel may be 0xF and it is wrong in this case. This happens because init_irq_default_affinity() sets all bits in irq_default_affinity variable by default. It is better to set the default value of affinity to the boot core to guarantee that value of irq_default_affinity contains at least one valid online CPU during the early stage of booting. It is necessary for proper configuration of affinity for common interrupt. Signed-off-by: Yuriy Kolerov --- arch/arc/kernel/irq.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/arc/kernel/irq.c b/arch/arc/kernel/irq.c index 538b36a..e53bfd5 100644 --- a/arch/arc/kernel/irq.c +++ b/arch/arc/kernel/irq.c @@ -20,6 +20,12 @@ */ void __init init_IRQ(void) { +#ifdef CONFIG_SMP + /* Set the default affinity to the boot cpu. */ + cpumask_clear(irq_default_affinity); + cpumask_set_cpu(smp_processor_id(), irq_default_affinity); +#endif + /* * process the entire interrupt tree in one go * Any external intc will be setup provided DT chains them