aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/acpi
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-06-09 04:19:52 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-06-21 17:05:42 -0400
commitd7f3d4781852f5160b939f526afbc21a813a0206 (patch)
tree1524a81dd5c6906cf1b291b5a959b774c5ded437 /arch/x86/kernel/acpi
parent84245af7297ced9e8fe837dc0fc4782438771bd2 (diff)
x86, irq: Introduce mechanisms to support dynamically allocate IRQ for IOAPIC
Currently x86 support identity mapping between GSI(IOAPIC pin) and IRQ number, so continous IRQs at low end are statically allocated to IOAPICs at boot time. This design causes trouble to support IOAPIC hotplug. This patch implements basic mechanism to dynamically allocate IRQ on demand for IOAPIC pins by using irqdomain framework. It first adds several fields into struct ioapic to support irqdomain. Then it implements an algorithm to dynamically allocate IRQ number for IOAPIC pins on demand. Currently it supports three types of irqdomain: 1) LEGACY: used to support IOAPIC hosting legacy IRQs and building identity mapping for legacy IRQs. A speical case, we dynamically allocate IRQ number for IOAPIC pin which has GSI number below nr_legacy_irqs() but isn't legacy IRQ. This is for backward compatibility and avoid regression. 2) STRICT: build identity mapping between GSI and IRQ nubmer. 3) DYNAMIC: dynamically allocate IRQ number for IOAPIC pin on demand. Legacy(ISA) IRQs is not managed by irqdomain because there may be multiple pins sharing the same IRQ number and current irqdomain only supports 1:1 mapping between pins and IRQ. Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.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: 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> Link: http://lkml.kernel.org/r/1402302011-23642-24-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/acpi')
-rw-r--r--arch/x86/kernel/acpi/boot.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 0cf311c72bce..d6635baf9e3d 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -100,7 +100,7 @@ static u32 isa_irq_to_gsi[NR_IRQS_LEGACY] __read_mostly = {
100 100
101#define ACPI_INVALID_GSI INT_MIN 101#define ACPI_INVALID_GSI INT_MIN
102 102
103static int map_gsi_to_irq(unsigned int gsi) 103static int map_gsi_to_irq(unsigned int gsi, unsigned int flags)
104{ 104{
105 int i; 105 int i;
106 106
@@ -108,7 +108,7 @@ static int map_gsi_to_irq(unsigned int gsi)
108 if (isa_irq_to_gsi[i] == gsi) 108 if (isa_irq_to_gsi[i] == gsi)
109 return i; 109 return i;
110 110
111 return mp_map_gsi_to_irq(gsi); 111 return mp_map_gsi_to_irq(gsi, flags);
112} 112}
113 113
114/* 114/*
@@ -417,7 +417,7 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger,
417 if (acpi_gbl_FADT.sci_interrupt == gsi) 417 if (acpi_gbl_FADT.sci_interrupt == gsi)
418 return gsi; 418 return gsi;
419 419
420 irq = map_gsi_to_irq(gsi); 420 irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC);
421 if (irq < 0) 421 if (irq < 0)
422 return irq; 422 return irq;
423 423
@@ -608,7 +608,7 @@ void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
608 608
609int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp) 609int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp)
610{ 610{
611 int irq = map_gsi_to_irq(gsi); 611 int irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK);
612 612
613 if (irq >= 0) { 613 if (irq >= 0) {
614#ifdef CONFIG_X86_IO_APIC 614#ifdef CONFIG_X86_IO_APIC