aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/apic
diff options
context:
space:
mode:
authorWeidong Han <weidong.han@intel.com>2009-04-17 04:42:16 -0400
committerIngo Molnar <mingo@elte.hu>2009-04-19 04:22:05 -0400
commit9a2755c3569e4db92bd9b1daadeddb4045b0cccd (patch)
tree21a7e3da7d85fbcba0fdedf791078258ea151c72 /arch/x86/kernel/apic
parent03ea81550676296d94596e4337c771c6ba29f542 (diff)
x86, intr-remap: fix x2apic/intr-remap resume
Interrupt remapping was decoupled from x2apic. Shouldn't check x2apic before resume interrupt remapping. Otherwise, interrupt remapping won't be resumed when x2apic is not enabled. [ Impact: fix potential intr-remap resume hang on !x2apic ] Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Weidong Han <weidong.han@intel.com> Acked-by: David Woodhouse <David.Woodhouse@intel.com> Cc: iommu@lists.linux-foundation.org Cc: allen.m.kay@intel.com Cc: fenghua.yu@intel.com LKML-Reference: <1239957736-6161-6-git-send-email-weidong.han@intel.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r--arch/x86/kernel/apic/apic.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 0cf1eea750cc..7b41a32339e0 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -2032,7 +2032,7 @@ static int lapic_resume(struct sys_device *dev)
2032 return 0; 2032 return 0;
2033 2033
2034 local_irq_save(flags); 2034 local_irq_save(flags);
2035 if (x2apic) { 2035 if (intr_remapping_enabled) {
2036 ioapic_entries = alloc_ioapic_entries(); 2036 ioapic_entries = alloc_ioapic_entries();
2037 if (!ioapic_entries) { 2037 if (!ioapic_entries) {
2038 WARN(1, "Alloc ioapic_entries in lapic resume failed."); 2038 WARN(1, "Alloc ioapic_entries in lapic resume failed.");
@@ -2048,8 +2048,10 @@ static int lapic_resume(struct sys_device *dev)
2048 2048
2049 mask_IO_APIC_setup(ioapic_entries); 2049 mask_IO_APIC_setup(ioapic_entries);
2050 mask_8259A(); 2050 mask_8259A();
2051 enable_x2apic();
2052 } 2051 }
2052
2053 if (x2apic)
2054 enable_x2apic();
2053#else 2055#else
2054 if (!apic_pm_state.active) 2056 if (!apic_pm_state.active)
2055 return 0; 2057 return 0;
@@ -2097,10 +2099,12 @@ static int lapic_resume(struct sys_device *dev)
2097 apic_read(APIC_ESR); 2099 apic_read(APIC_ESR);
2098 2100
2099#ifdef CONFIG_INTR_REMAP 2101#ifdef CONFIG_INTR_REMAP
2100 if (intr_remapping_enabled) 2102 if (intr_remapping_enabled) {
2101 reenable_intr_remapping(EIM_32BIT_APIC_ID); 2103 if (x2apic)
2104 reenable_intr_remapping(EIM_32BIT_APIC_ID);
2105 else
2106 reenable_intr_remapping(EIM_8BIT_APIC_ID);
2102 2107
2103 if (x2apic) {
2104 unmask_8259A(); 2108 unmask_8259A();
2105 restore_IO_APIC_setup(ioapic_entries); 2109 restore_IO_APIC_setup(ioapic_entries);
2106 free_ioapic_entries(ioapic_entries); 2110 free_ioapic_entries(ioapic_entries);
@@ -2109,7 +2113,6 @@ static int lapic_resume(struct sys_device *dev)
2109 2113
2110 local_irq_restore(flags); 2114 local_irq_restore(flags);
2111 2115
2112
2113 return 0; 2116 return 0;
2114} 2117}
2115 2118