aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/io_apic.c
diff options
context:
space:
mode:
authorJiang Liu <jiang.liu@linux.intel.com>2014-06-09 04:20:11 -0400
committerThomas Gleixner <tglx@linutronix.de>2014-06-21 17:05:44 -0400
commitb81975eade8c6495f3c4d6746d22bdc95f617777 (patch)
treeb516e5daee5c5bd505ce1a39fe5798fd6672057a /arch/x86/kernel/apic/io_apic.c
parent00f49c29b3298806c74589a4ed016a2afb359e98 (diff)
x86, irq: Clean up irqdomain transition code
Now we have completely switched to irqdomain, so clean up transition code in IOAPIC drivers. 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> Link: http://lkml.kernel.org/r/1402302011-23642-43-git-send-email-jiang.liu@linux.intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/apic/io_apic.c')
-rw-r--r--arch/x86/kernel/apic/io_apic.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 8d80a8f1d670..a44dce8cc559 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -86,6 +86,7 @@ static DEFINE_RAW_SPINLOCK(ioapic_lock);
86static DEFINE_RAW_SPINLOCK(vector_lock); 86static DEFINE_RAW_SPINLOCK(vector_lock);
87static DEFINE_MUTEX(ioapic_mutex); 87static DEFINE_MUTEX(ioapic_mutex);
88static unsigned int ioapic_dynirq_base; 88static unsigned int ioapic_dynirq_base;
89static int ioapic_initialized;
89 90
90struct mp_pin_info { 91struct mp_pin_info {
91 int trigger; 92 int trigger;
@@ -1034,13 +1035,8 @@ static int mp_map_pin_to_irq(u32 gsi, int idx, int ioapic, int pin,
1034 struct irq_domain *domain = mp_ioapic_irqdomain(ioapic); 1035 struct irq_domain *domain = mp_ioapic_irqdomain(ioapic);
1035 struct mp_pin_info *info = mp_pin_info(ioapic, pin); 1036 struct mp_pin_info *info = mp_pin_info(ioapic, pin);
1036 1037
1037 if (!domain) { 1038 if (!domain)
1038 /* 1039 return -1;
1039 * Provide an identity mapping of gsi == irq except on truly
1040 * weird platforms that have non isa irqs in the first 16 gsis.
1041 */
1042 return gsi >= nr_legacy_irqs() ? gsi : gsi_top + gsi;
1043 }
1044 1040
1045 mutex_lock(&ioapic_mutex); 1041 mutex_lock(&ioapic_mutex);
1046 1042
@@ -2986,6 +2982,8 @@ void __init setup_IO_APIC(void)
2986 init_IO_APIC_traps(); 2982 init_IO_APIC_traps();
2987 if (nr_legacy_irqs()) 2983 if (nr_legacy_irqs())
2988 check_timer(); 2984 check_timer();
2985
2986 ioapic_initialized = 1;
2989} 2987}
2990 2988
2991/* 2989/*
@@ -3461,12 +3459,11 @@ static int __init io_apic_get_redir_entries(int ioapic)
3461 3459
3462unsigned int arch_dynirq_lower_bound(unsigned int from) 3460unsigned int arch_dynirq_lower_bound(unsigned int from)
3463{ 3461{
3464 unsigned int min = gsi_top + nr_legacy_irqs(); 3462 /*
3465 3463 * dmar_alloc_hwirq() may be called before setup_IO_APIC(), so use
3466 if (ioapic_dynirq_base) 3464 * gsi_top if ioapic_dynirq_base hasn't been initialized yet.
3467 return ioapic_dynirq_base; 3465 */
3468 3466 return ioapic_initialized ? ioapic_dynirq_base : gsi_top;
3469 return from < min ? min : from;
3470} 3467}
3471 3468
3472int __init arch_probe_nr_irqs(void) 3469int __init arch_probe_nr_irqs(void)
@@ -3841,10 +3838,7 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base,
3841 ioapics[idx].mp_config.flags = MPC_APIC_USABLE; 3838 ioapics[idx].mp_config.flags = MPC_APIC_USABLE;
3842 ioapics[idx].mp_config.apicaddr = address; 3839 ioapics[idx].mp_config.apicaddr = address;
3843 ioapics[idx].irqdomain = NULL; 3840 ioapics[idx].irqdomain = NULL;
3844 if (cfg) 3841 ioapics[idx].irqdomain_cfg = *cfg;
3845 ioapics[idx].irqdomain_cfg = *cfg;
3846 else
3847 ioapics[idx].irqdomain_cfg.type = IOAPIC_DOMAIN_INVALID;
3848 3842
3849 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address); 3843 set_fixmap_nocache(FIX_IO_APIC_BASE_0 + idx, address);
3850 3844