Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86/apic changes from Ingo Molnar:
"Smaller fixes"

* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/ioapic: Check attr against the previous setting when programmed more than once
x86/ioapic/kcrash: Prevent crash_kexec() from deadlocking on ioapic_lock
x86/acpi: Fix incorrect sanity check in acpi_register_lapic()

+21 -6
+2
arch/x86/include/asm/apic.h
··· 715 715 ack_APIC_irq(); 716 716 } 717 717 718 + extern void ioapic_zap_locks(void); 719 + 718 720 #endif /* _ASM_X86_APIC_H */
+5 -2
arch/x86/kernel/acpi/boot.c
··· 199 199 { 200 200 unsigned int ver = 0; 201 201 202 - if (id >= (MAX_LOCAL_APIC-1)) { 202 + if (id >= MAX_LOCAL_APIC) { 203 203 printk(KERN_INFO PREFIX "skipped apicid that is too big\n"); 204 204 return; 205 205 } ··· 1120 1120 int ioapic; 1121 1121 int ioapic_pin; 1122 1122 struct io_apic_irq_attr irq_attr; 1123 + int ret; 1123 1124 1124 1125 if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) 1125 1126 return gsi; ··· 1150 1149 set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin, 1151 1150 trigger == ACPI_EDGE_SENSITIVE ? 0 : 1, 1152 1151 polarity == ACPI_ACTIVE_HIGH ? 0 : 1); 1153 - io_apic_set_pci_routing(dev, gsi_to_irq(gsi), &irq_attr); 1152 + ret = io_apic_set_pci_routing(dev, gsi_to_irq(gsi), &irq_attr); 1153 + if (ret < 0) 1154 + gsi = INT_MIN; 1154 1155 1155 1156 return gsi; 1156 1157 }
+11 -3
arch/x86/kernel/apic/io_apic.c
··· 1534 1534 } 1535 1535 } 1536 1536 1537 + void ioapic_zap_locks(void) 1538 + { 1539 + raw_spin_lock_init(&ioapic_lock); 1540 + } 1541 + 1537 1542 __apicdebuginit(void) print_IO_APIC(int ioapic_idx) 1538 1543 { 1539 1544 union IO_APIC_reg_00 reg_00; ··· 3380 3375 { 3381 3376 unsigned int ioapic_idx = attr->ioapic, pin = attr->ioapic_pin; 3382 3377 int ret; 3378 + struct IO_APIC_route_entry orig_entry; 3383 3379 3384 3380 /* Avoid redundant programming */ 3385 3381 if (test_bit(pin, ioapics[ioapic_idx].pin_programmed)) { 3386 - pr_debug("Pin %d-%d already programmed\n", 3387 - mpc_ioapic_id(ioapic_idx), pin); 3388 - return 0; 3382 + pr_debug("Pin %d-%d already programmed\n", mpc_ioapic_id(ioapic_idx), pin); 3383 + orig_entry = ioapic_read_entry(attr->ioapic, pin); 3384 + if (attr->trigger == orig_entry.trigger && attr->polarity == orig_entry.polarity) 3385 + return 0; 3386 + return -EBUSY; 3389 3387 } 3390 3388 ret = io_apic_setup_irq_pin(irq, node, attr); 3391 3389 if (!ret)
+3 -1
arch/x86/kernel/crash.c
··· 128 128 cpu_emergency_svm_disable(); 129 129 130 130 lapic_shutdown(); 131 - #if defined(CONFIG_X86_IO_APIC) 131 + #ifdef CONFIG_X86_IO_APIC 132 + /* Prevent crash_kexec() from deadlocking on ioapic_lock. */ 133 + ioapic_zap_locks(); 132 134 disable_IO_APIC(); 133 135 #endif 134 136 #ifdef CONFIG_HPET_TIMER