Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754248AbaDFFjg (ORCPT ); Sun, 6 Apr 2014 01:39:36 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:19254 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753597AbaDFFjF (ORCPT ); Sun, 6 Apr 2014 01:39:05 -0400 From: Yinghai Lu To: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Tony Luck Cc: linux-kernel@vger.kernel.org, Yinghai Lu , Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com Subject: [RFC PATCH 4/5] s390: Mark bits in allocated_irqs in general code Date: Sat, 5 Apr 2014 22:39:25 -0700 Message-Id: <1396762766-4942-5-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1396762766-4942-1-git-send-email-yinghai@kernel.org> References: <1396762766-4942-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Second irq_reserve_irqs calling is from arch s390, and s390 does not use SPARSE_IRQ yet. We could set bits for legacy bits early in !SPARSE_IRQ version early_irq_init() directly instead of calling irq_reserve_irqs later. Adding weak version arch_proble_early_allocate_nr_irqs() for !SPARESE_IRQ, and let s390 to have specific version to pass correct irq number that need to be marked in allocated_irqs. Signed-off-by: Yinghai Lu Cc: Martin Schwidefsky Cc: Heiko Carstens Cc: linux390@de.ibm.com --- arch/s390/kernel/irq.c | 6 +++++- include/linux/irq.h | 1 + kernel/irq/irqdesc.c | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/arch/s390/kernel/irq.c b/arch/s390/kernel/irq.c index d42b14c..2838928 100644 --- a/arch/s390/kernel/irq.c +++ b/arch/s390/kernel/irq.c @@ -90,9 +90,13 @@ static const struct irq_class irqclass_sub_desc[NR_ARCH_IRQS] = { [CPU_RST] = {.name = "RST", .desc = "[CPU] CPU Restart"}, }; +int arch_probe_early_allocate_nr_irqs(void) +{ + return THIN_INTERRUPT; +} + void __init init_IRQ(void) { - irq_reserve_irqs(0, THIN_INTERRUPT); init_cio_interrupts(); init_airq_interrupts(); init_ext_interrupts(); diff --git a/include/linux/irq.h b/include/linux/irq.h index d278838..7588ee9 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -623,6 +623,7 @@ int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node, void irq_free_descs(unsigned int irq, unsigned int cnt); int irq_reserve_irqs(unsigned int from, unsigned int cnt); +int arch_probe_early_allocate_nr_irqs(void); static inline void irq_free_desc(unsigned int irq) { diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index a7174617..dfb971c 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c @@ -248,10 +248,16 @@ struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned_in_smp = { } }; +int __weak arch_probe_early_allocate_nr_irqs(void) +{ + return 0; +} + int __init early_irq_init(void) { int count, i, node = first_online_node; struct irq_desc *desc; + int nr = arch_probe_early_allocate_nr_irqs(); init_irq_default_affinity(); @@ -267,6 +273,10 @@ int __init early_irq_init(void) lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); desc_set_defaults(i, &desc[i], node, NULL); } + + for (i = 0; i < nr; i++) + set_bit(i, allocated_irqs); + return arch_early_irq_init(); } -- 1.8.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/