From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932645AbcLIJ7x (ORCPT ); Fri, 9 Dec 2016 04:59:53 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:60037 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753178AbcLIJ7n (ORCPT ); Fri, 9 Dec 2016 04:59:43 -0500 From: Yuriy Kolerov To: linux-snps-arc@lists.infradead.org Cc: Vineet.Gupta1@synopsys.com, Alexey.Brodkin@synopsys.com, linux-kernel@vger.kernel.org, tglx@linutronix.de, Yuriy Kolerov 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 -- 2.7.4