Commit 2dfbba90 authored by Andy Grover's avatar Andy Grover

ACPI: Ensure that the SCI has the proper polarity and trigger, even

on systems that do not have an interrupt override entry in the MADT.
parent 96e1676b
......@@ -1885,7 +1885,7 @@ int io_apic_set_pci_routing (int ioapic, int pin, int irq)
io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
spin_unlock_irqrestore(&ioapic_lock, flags);
return entry.vector;
return 0;
}
#endif /*CONFIG_ACPI_BOOT*/
......@@ -1049,8 +1049,20 @@ void __init mp_config_acpi_legacy_irqs (void)
if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!\n");
}
}
return;
/* Ensure the ACPI SCI interrupt level is active low, edge-triggered */
void __init mp_config_ioapic_for_sci(int irq)
{
int ioapic;
int ioapic_pin;
ioapic = mp_find_ioapic(irq);
ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start;
io_apic_set_pci_routing(ioapic, ioapic_pin, irq);
}
#ifdef CONFIG_ACPI_PCI
......@@ -1059,7 +1071,6 @@ void __init mp_parse_prt (void)
{
struct list_head *node = NULL;
struct acpi_prt_entry *entry = NULL;
int vector = 0;
int ioapic = -1;
int ioapic_pin = 0;
int irq = 0;
......@@ -1104,14 +1115,13 @@ void __init mp_parse_prt (void)
mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
vector = io_apic_set_pci_routing(ioapic, ioapic_pin, irq);
if (vector)
if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq))
entry->irq = irq;
printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> vector 0x%02x"
" -> IRQ %d\n", entry->id.segment, entry->id.bus,
printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
entry->id.segment, entry->id.bus,
entry->id.device, ('A' + entry->pin),
mp_ioapic_routing[ioapic].apic_id, ioapic_pin, vector,
mp_ioapic_routing[ioapic].apic_id, ioapic_pin,
entry->irq);
}
......
......@@ -612,7 +612,7 @@ acpi_bus_init (void)
#ifdef CONFIG_X86
/* Ensure the SCI is set to level-triggered, active-low */
if (acpi_ioapic)
mp_override_legacy_irq(acpi_fadt.sci_int, 3, 3, acpi_fadt.sci_int);
mp_config_ioapic_for_sci(acpi_fadt.sci_int);
else
eisa_set_level_irq(acpi_fadt.sci_int);
#endif
......
......@@ -226,6 +226,7 @@ extern void mp_register_lapic_address (u64 address);
extern void mp_register_ioapic (u8 id, u32 address, u32 irq_base);
extern void mp_override_legacy_irq (u8 bus_irq, u8 polarity, u8 trigger, u32 global_irq);
extern void mp_config_acpi_legacy_irqs (void);
extern void mp_config_ioapic_for_sci(int irq);
extern void mp_parse_prt (void);
#endif /*CONFIG_ACPI_BOOT*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment