From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966864AbbDXQDj (ORCPT ); Fri, 24 Apr 2015 12:03:39 -0400 Received: from terminus.zytor.com ([198.137.202.10]:45134 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965348AbbDXQDe (ORCPT ); Fri, 24 Apr 2015 12:03:34 -0400 Date: Fri, 24 Apr 2015 09:02:24 -0700 From: tip-bot for Jiang Liu Message-ID: Cc: linux@eikelenboom.it, benh@kernel.crashing.org, tony.luck@intel.com, rdunlap@infradead.org, david.vrabel@citrix.com, tglx@linutronix.de, rjw@rjwysocki.net, bhelgaas@google.com, jiang.liu@linux.intel.com, sivanich@sgi.com, jroedel@suse.de, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, mingo@kernel.org, konrad.wilk@oracle.com, joro@8bytes.org, hpa@zytor.com, david.a.cohen@linux.intel.com, JBeulich@suse.com, bp@alien8.de, yinghai@kernel.org Reply-To: linux@eikelenboom.it, benh@kernel.crashing.org, tony.luck@intel.com, rdunlap@infradead.org, david.vrabel@citrix.com, tglx@linutronix.de, rjw@rjwysocki.net, bhelgaas@google.com, jiang.liu@linux.intel.com, jroedel@suse.de, sivanich@sgi.com, joro@8bytes.org, hpa@zytor.com, konrad.wilk@oracle.com, mingo@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, JBeulich@suse.com, david.a.cohen@linux.intel.com, bp@alien8.de, yinghai@kernel.org In-Reply-To: <1428978610-28986-28-git-send-email-jiang.liu@linux.intel.com> References: <1428978610-28986-28-git-send-email-jiang.liu@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/irq: Refine the way to calculate NR_IRQS Git-Commit-ID: 4399b14fa75c8d8225a0739fbcef575f02c6c6a5 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 4399b14fa75c8d8225a0739fbcef575f02c6c6a5 Gitweb: http://git.kernel.org/tip/4399b14fa75c8d8225a0739fbcef575f02c6c6a5 Author: Jiang Liu AuthorDate: Tue, 14 Apr 2015 10:30:04 +0800 Committer: Thomas Gleixner CommitDate: Fri, 24 Apr 2015 15:36:55 +0200 x86/irq: Refine the way to calculate NR_IRQS Now we have made MSI independent of IOAPIC, so we need to refine the way to calculate NR_IRQS to support configuration with MSI enabled but IOAPIC disabled. Signed-off-by: Jiang Liu Tested-by: Joerg Roedel Cc: Konrad Rzeszutek Wilk Cc: David Cohen Cc: Sander Eikelenboom Cc: David Vrabel Cc: Tony Luck Cc: Joerg Roedel Cc: Greg Kroah-Hartman Cc: Bjorn Helgaas Cc: Benjamin Herrenschmidt Cc: Rafael J. Wysocki Cc: Randy Dunlap Cc: Yinghai Lu Cc: Borislav Petkov Cc: Dimitri Sivanich Cc: Jan Beulich Link: http://lkml.kernel.org/r/1428978610-28986-28-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/irq_vectors.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/irq_vectors.h b/arch/x86/include/asm/irq_vectors.h index 666c89e..b26cb12 100644 --- a/arch/x86/include/asm/irq_vectors.h +++ b/arch/x86/include/asm/irq_vectors.h @@ -155,18 +155,22 @@ static inline int invalid_vm86_irq(int irq) * static arrays. */ -#define NR_IRQS_LEGACY 16 +#define NR_IRQS_LEGACY 16 -#define IO_APIC_VECTOR_LIMIT ( 32 * MAX_IO_APICS ) +#define CPU_VECTOR_LIMIT (64 * NR_CPUS) +#define IO_APIC_VECTOR_LIMIT (32 * MAX_IO_APICS) -#ifdef CONFIG_X86_IO_APIC -# define CPU_VECTOR_LIMIT (64 * NR_CPUS) -# define NR_IRQS \ +#if defined(CONFIG_X86_IO_APIC) && defined(CONFIG_PCI_MSI) +#define NR_IRQS \ (CPU_VECTOR_LIMIT > IO_APIC_VECTOR_LIMIT ? \ (NR_VECTORS + CPU_VECTOR_LIMIT) : \ (NR_VECTORS + IO_APIC_VECTOR_LIMIT)) -#else /* !CONFIG_X86_IO_APIC: */ -# define NR_IRQS NR_IRQS_LEGACY +#elif defined(CONFIG_X86_IO_APIC) +#define NR_IRQS (NR_VECTORS + IO_APIC_VECTOR_LIMIT) +#elif defined(CONFIG_PCI_MSI) +#define NR_IRQS (NR_VECTORS + CPU_VECTOR_LIMIT) +#else +#define NR_IRQS NR_IRQS_LEGACY #endif #endif /* _ASM_X86_IRQ_VECTORS_H */