diff options
Diffstat (limited to 'arch/x86/kernel/apic/apic.c')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 30909a258d0f..85eb8e100818 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -809,7 +809,7 @@ void clear_local_APIC(void) | |||
809 | u32 v; | 809 | u32 v; |
810 | 810 | ||
811 | /* APIC hasn't been mapped yet */ | 811 | /* APIC hasn't been mapped yet */ |
812 | if (!apic_phys) | 812 | if (!x2apic && !apic_phys) |
813 | return; | 813 | return; |
814 | 814 | ||
815 | maxlvt = lapic_get_maxlvt(); | 815 | maxlvt = lapic_get_maxlvt(); |
@@ -1334,15 +1334,16 @@ void __init enable_IR_x2apic(void) | |||
1334 | return; | 1334 | return; |
1335 | } | 1335 | } |
1336 | 1336 | ||
1337 | local_irq_save(flags); | 1337 | ret = save_IO_APIC_setup(); |
1338 | mask_8259A(); | ||
1339 | |||
1340 | ret = save_mask_IO_APIC_setup(); | ||
1341 | if (ret) { | 1338 | if (ret) { |
1342 | pr_info("Saving IO-APIC state failed: %d\n", ret); | 1339 | pr_info("Saving IO-APIC state failed: %d\n", ret); |
1343 | goto end; | 1340 | goto end; |
1344 | } | 1341 | } |
1345 | 1342 | ||
1343 | local_irq_save(flags); | ||
1344 | mask_IO_APIC_setup(); | ||
1345 | mask_8259A(); | ||
1346 | |||
1346 | ret = enable_intr_remapping(1); | 1347 | ret = enable_intr_remapping(1); |
1347 | 1348 | ||
1348 | if (ret && x2apic_preenabled) { | 1349 | if (ret && x2apic_preenabled) { |
@@ -1367,10 +1368,10 @@ end_restore: | |||
1367 | else | 1368 | else |
1368 | reinit_intr_remapped_IO_APIC(x2apic_preenabled); | 1369 | reinit_intr_remapped_IO_APIC(x2apic_preenabled); |
1369 | 1370 | ||
1370 | end: | ||
1371 | unmask_8259A(); | 1371 | unmask_8259A(); |
1372 | local_irq_restore(flags); | 1372 | local_irq_restore(flags); |
1373 | 1373 | ||
1374 | end: | ||
1374 | if (!ret) { | 1375 | if (!ret) { |
1375 | if (!x2apic_preenabled) | 1376 | if (!x2apic_preenabled) |
1376 | pr_info("Enabled x2apic and interrupt-remapping\n"); | 1377 | pr_info("Enabled x2apic and interrupt-remapping\n"); |
@@ -1523,12 +1524,10 @@ void __init early_init_lapic_mapping(void) | |||
1523 | */ | 1524 | */ |
1524 | void __init init_apic_mappings(void) | 1525 | void __init init_apic_mappings(void) |
1525 | { | 1526 | { |
1526 | #ifdef CONFIG_X86_X2APIC | ||
1527 | if (x2apic) { | 1527 | if (x2apic) { |
1528 | boot_cpu_physical_apicid = read_apic_id(); | 1528 | boot_cpu_physical_apicid = read_apic_id(); |
1529 | return; | 1529 | return; |
1530 | } | 1530 | } |
1531 | #endif | ||
1532 | 1531 | ||
1533 | /* | 1532 | /* |
1534 | * If no local APIC can be found then set up a fake all | 1533 | * If no local APIC can be found then set up a fake all |
@@ -1972,12 +1971,9 @@ static int lapic_resume(struct sys_device *dev) | |||
1972 | 1971 | ||
1973 | local_irq_save(flags); | 1972 | local_irq_save(flags); |
1974 | 1973 | ||
1975 | #ifdef CONFIG_X86_X2APIC | ||
1976 | if (x2apic) | 1974 | if (x2apic) |
1977 | enable_x2apic(); | 1975 | enable_x2apic(); |
1978 | else | 1976 | else { |
1979 | #endif | ||
1980 | { | ||
1981 | /* | 1977 | /* |
1982 | * Make sure the APICBASE points to the right address | 1978 | * Make sure the APICBASE points to the right address |
1983 | * | 1979 | * |