aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic/apic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r--arch/x86/kernel/apic/apic.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index edc24480469f..3722179a49db 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -35,6 +35,7 @@
35#include <linux/smp.h> 35#include <linux/smp.h>
36#include <linux/mm.h> 36#include <linux/mm.h>
37 37
38#include <asm/irq_remapping.h>
38#include <asm/perf_event.h> 39#include <asm/perf_event.h>
39#include <asm/x86_init.h> 40#include <asm/x86_init.h>
40#include <asm/pgalloc.h> 41#include <asm/pgalloc.h>
@@ -1441,8 +1442,8 @@ void __init bsp_end_local_APIC_setup(void)
1441 * Now that local APIC setup is completed for BP, configure the fault 1442 * Now that local APIC setup is completed for BP, configure the fault
1442 * handling for interrupt remapping. 1443 * handling for interrupt remapping.
1443 */ 1444 */
1444 if (intr_remapping_enabled) 1445 if (irq_remapping_enabled)
1445 enable_drhd_fault_handling(); 1446 irq_remap_enable_fault_handling();
1446 1447
1447} 1448}
1448 1449
@@ -1517,7 +1518,7 @@ void enable_x2apic(void)
1517int __init enable_IR(void) 1518int __init enable_IR(void)
1518{ 1519{
1519#ifdef CONFIG_IRQ_REMAP 1520#ifdef CONFIG_IRQ_REMAP
1520 if (!intr_remapping_supported()) { 1521 if (!irq_remapping_supported()) {
1521 pr_debug("intr-remapping not supported\n"); 1522 pr_debug("intr-remapping not supported\n");
1522 return -1; 1523 return -1;
1523 } 1524 }
@@ -1528,7 +1529,7 @@ int __init enable_IR(void)
1528 return -1; 1529 return -1;
1529 } 1530 }
1530 1531
1531 return enable_intr_remapping(); 1532 return irq_remapping_enable();
1532#endif 1533#endif
1533 return -1; 1534 return -1;
1534} 1535}
@@ -1537,10 +1538,13 @@ void __init enable_IR_x2apic(void)
1537{ 1538{
1538 unsigned long flags; 1539 unsigned long flags;
1539 int ret, x2apic_enabled = 0; 1540 int ret, x2apic_enabled = 0;
1540 int dmar_table_init_ret; 1541 int hardware_init_ret;
1541 1542
1542 dmar_table_init_ret = dmar_table_init(); 1543 /* Make sure irq_remap_ops are initialized */
1543 if (dmar_table_init_ret && !x2apic_supported()) 1544 setup_irq_remapping_ops();
1545
1546 hardware_init_ret = irq_remapping_prepare();
1547 if (hardware_init_ret && !x2apic_supported())
1544 return; 1548 return;
1545 1549
1546 ret = save_ioapic_entries(); 1550 ret = save_ioapic_entries();
@@ -1556,7 +1560,7 @@ void __init enable_IR_x2apic(void)
1556 if (x2apic_preenabled && nox2apic) 1560 if (x2apic_preenabled && nox2apic)
1557 disable_x2apic(); 1561 disable_x2apic();
1558 1562
1559 if (dmar_table_init_ret) 1563 if (hardware_init_ret)
1560 ret = -1; 1564 ret = -1;
1561 else 1565 else
1562 ret = enable_IR(); 1566 ret = enable_IR();
@@ -2176,8 +2180,8 @@ static int lapic_suspend(void)
2176 local_irq_save(flags); 2180 local_irq_save(flags);
2177 disable_local_APIC(); 2181 disable_local_APIC();
2178 2182
2179 if (intr_remapping_enabled) 2183 if (irq_remapping_enabled)
2180 disable_intr_remapping(); 2184 irq_remapping_disable();
2181 2185
2182 local_irq_restore(flags); 2186 local_irq_restore(flags);
2183 return 0; 2187 return 0;
@@ -2193,7 +2197,7 @@ static void lapic_resume(void)
2193 return; 2197 return;
2194 2198
2195 local_irq_save(flags); 2199 local_irq_save(flags);
2196 if (intr_remapping_enabled) { 2200 if (irq_remapping_enabled) {
2197 /* 2201 /*
2198 * IO-APIC and PIC have their own resume routines. 2202 * IO-APIC and PIC have their own resume routines.
2199 * We just mask them here to make sure the interrupt 2203 * We just mask them here to make sure the interrupt
@@ -2245,8 +2249,8 @@ static void lapic_resume(void)
2245 apic_write(APIC_ESR, 0); 2249 apic_write(APIC_ESR, 0);
2246 apic_read(APIC_ESR); 2250 apic_read(APIC_ESR);
2247 2251
2248 if (intr_remapping_enabled) 2252 if (irq_remapping_enabled)
2249 reenable_intr_remapping(x2apic_mode); 2253 irq_remapping_reenable(x2apic_mode);
2250 2254
2251 local_irq_restore(flags); 2255 local_irq_restore(flags);
2252} 2256}