diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2014-06-09 16:19:48 +0800 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2014-06-21 23:05:42 +0200 |
commit | 95d76acc7518d566df18d67c1343bb375b78d1f3 (patch) | |
tree | d0e826c07402d4df28042792951b4b647048c5a1 /arch/x86/kernel/devicetree.c | |
parent | 6532ce994c304835f3bfc8479acce9d102cd8b5b (diff) | |
download | talos-op-linux-95d76acc7518d566df18d67c1343bb375b78d1f3.tar.gz talos-op-linux-95d76acc7518d566df18d67c1343bb375b78d1f3.zip |
x86, irq: Count legacy IRQs by legacy_pic->nr_legacy_irqs instead of NR_IRQS_LEGACY
Some platforms, such as Intel MID and mshypv, do not support legacy
interrupt controllers. So count legacy IRQs by legacy_pic->nr_legacy_irqs
instead of hard-coded NR_IRQS_LEGACY.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: xen-devel@lists.xenproject.org
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Michal Simek <monstr@monstr.eu>
Cc: Tony Lindgren <tony@atomide.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Link: http://lkml.kernel.org/r/1402302011-23642-20-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/devicetree.c')
-rw-r--r-- | arch/x86/kernel/devicetree.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c index 7db54b5d5f86..b4680058db8b 100644 --- a/arch/x86/kernel/devicetree.c +++ b/arch/x86/kernel/devicetree.c @@ -21,6 +21,7 @@ #include <asm/apic.h> #include <asm/pci_x86.h> #include <asm/setup.h> +#include <asm/i8259.h> __initdata u64 initial_dtb; char __initdata cmd_line[COMMAND_LINE_SIZE]; @@ -314,7 +315,7 @@ static void dt_add_ioapic_domain(unsigned int ioapic_num, struct irq_domain *id; struct mp_ioapic_gsi *gsi_cfg; int ret; - int num; + int num, legacy_irqs = nr_legacy_irqs(); gsi_cfg = mp_ioapic_gsi_routing(ioapic_num); num = gsi_cfg->gsi_end - gsi_cfg->gsi_base + 1; @@ -324,17 +325,17 @@ static void dt_add_ioapic_domain(unsigned int ioapic_num, BUG_ON(!id); if (gsi_cfg->gsi_base == 0) { /* - * The first NR_IRQS_LEGACY irq descs are allocated in + * The first nr_legacy_irqs() irq descs are allocated in * early_irq_init() and need just a mapping. The * remaining irqs need both. All of them are preallocated * and assigned so we can keep the 1:1 mapping which the ioapic * is having. */ - irq_domain_associate_many(id, 0, 0, NR_IRQS_LEGACY); + irq_domain_associate_many(id, 0, 0, legacy_irqs); - if (num > NR_IRQS_LEGACY) { - ret = irq_create_strict_mappings(id, NR_IRQS_LEGACY, - NR_IRQS_LEGACY, num - NR_IRQS_LEGACY); + if (num > legacy_irqs) { + ret = irq_create_strict_mappings(id, legacy_irqs, + legacy_irqs, num - legacy_irqs); if (ret) pr_err("Error creating mapping for the " "remaining IRQs: %d\n", ret); |