diff options
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 44 |
1 files changed, 12 insertions, 32 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 8d9aee1e67e8..9add76f15cb0 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -405,11 +405,7 @@ static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger, | |||
405 | static int mp_register_gsi(struct device *dev, u32 gsi, int trigger, | 405 | static int mp_register_gsi(struct device *dev, u32 gsi, int trigger, |
406 | int polarity) | 406 | int polarity) |
407 | { | 407 | { |
408 | int irq; | 408 | int irq, node; |
409 | int ioapic; | ||
410 | int ioapic_pin; | ||
411 | struct io_apic_irq_attr irq_attr; | ||
412 | int ret; | ||
413 | 409 | ||
414 | if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) | 410 | if (acpi_irq_model != ACPI_IRQ_MODEL_IOAPIC) |
415 | return gsi; | 411 | return gsi; |
@@ -418,39 +414,27 @@ static int mp_register_gsi(struct device *dev, u32 gsi, int trigger, | |||
418 | if (acpi_gbl_FADT.sci_interrupt == gsi) | 414 | if (acpi_gbl_FADT.sci_interrupt == gsi) |
419 | return gsi; | 415 | return gsi; |
420 | 416 | ||
417 | trigger = trigger == ACPI_EDGE_SENSITIVE ? 0 : 1; | ||
418 | polarity = polarity == ACPI_ACTIVE_HIGH ? 0 : 1; | ||
419 | node = dev ? dev_to_node(dev) : NUMA_NO_NODE; | ||
420 | if (mp_set_gsi_attr(gsi, trigger, polarity, node)) { | ||
421 | pr_warn("Failed to set pin attr for GSI%d\n", gsi); | ||
422 | return -1; | ||
423 | } | ||
424 | |||
421 | irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC); | 425 | irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC); |
422 | if (irq < 0) | 426 | if (irq < 0) |
423 | return irq; | 427 | return irq; |
424 | 428 | ||
425 | ioapic = mp_find_ioapic(gsi); | ||
426 | if (ioapic < 0) { | ||
427 | printk(KERN_WARNING "No IOAPIC for GSI %u\n", gsi); | ||
428 | return gsi; | ||
429 | } | ||
430 | |||
431 | ioapic_pin = mp_find_ioapic_pin(ioapic, gsi); | ||
432 | |||
433 | if (ioapic_pin > MP_MAX_IOAPIC_PIN) { | ||
434 | printk(KERN_ERR "Invalid reference to IOAPIC pin " | ||
435 | "%d-%d\n", mpc_ioapic_id(ioapic), | ||
436 | ioapic_pin); | ||
437 | return gsi; | ||
438 | } | ||
439 | |||
440 | if (enable_update_mptable) | 429 | if (enable_update_mptable) |
441 | mp_config_acpi_gsi(dev, gsi, trigger, polarity); | 430 | mp_config_acpi_gsi(dev, gsi, trigger, polarity); |
442 | 431 | ||
443 | set_io_apic_irq_attr(&irq_attr, ioapic, ioapic_pin, | ||
444 | trigger == ACPI_EDGE_SENSITIVE ? 0 : 1, | ||
445 | polarity == ACPI_ACTIVE_HIGH ? 0 : 1); | ||
446 | ret = io_apic_set_pci_routing(dev, irq, &irq_attr); | ||
447 | if (ret < 0) | ||
448 | irq = -1; | ||
449 | |||
450 | return irq; | 432 | return irq; |
451 | } | 433 | } |
452 | 434 | ||
453 | static struct irq_domain_ops acpi_irqdomain_ops; | 435 | static struct irq_domain_ops acpi_irqdomain_ops = { |
436 | .map = mp_irqdomain_map, | ||
437 | }; | ||
454 | 438 | ||
455 | static int __init | 439 | static int __init |
456 | acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end) | 440 | acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end) |
@@ -622,10 +606,6 @@ int acpi_gsi_to_irq(u32 gsi, unsigned int *irqp) | |||
622 | int irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); | 606 | int irq = map_gsi_to_irq(gsi, IOAPIC_MAP_ALLOC | IOAPIC_MAP_CHECK); |
623 | 607 | ||
624 | if (irq >= 0) { | 608 | if (irq >= 0) { |
625 | #ifdef CONFIG_X86_IO_APIC | ||
626 | if (acpi_irq_model == ACPI_IRQ_MODEL_IOAPIC) | ||
627 | setup_IO_APIC_irq_extra(gsi); | ||
628 | #endif | ||
629 | *irqp = irq; | 609 | *irqp = irq; |
630 | return 0; | 610 | return 0; |
631 | } | 611 | } |