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) ...@@ -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)); io_apic_write(ioapic, 0x10+2*pin, *(((int *)&entry)+0));
spin_unlock_irqrestore(&ioapic_lock, flags); spin_unlock_irqrestore(&ioapic_lock, flags);
return entry.vector; return 0;
} }
#endif /*CONFIG_ACPI_BOOT*/ #endif /*CONFIG_ACPI_BOOT*/
...@@ -976,7 +976,7 @@ void __init mp_override_legacy_irq ( ...@@ -976,7 +976,7 @@ void __init mp_override_legacy_irq (
intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */ intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid; /* APIC ID */
intsrc.mpc_dstirq = pin; /* INTIN# */ intsrc.mpc_dstirq = pin; /* INTIN# */
Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n", Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, %d-%d\n",
intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3,
(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, (intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus,
intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq); intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, intsrc.mpc_dstirq);
...@@ -1049,8 +1049,20 @@ void __init mp_config_acpi_legacy_irqs (void) ...@@ -1049,8 +1049,20 @@ void __init mp_config_acpi_legacy_irqs (void)
if (++mp_irq_entries == MAX_IRQ_SOURCES) if (++mp_irq_entries == MAX_IRQ_SOURCES)
panic("Max # of irq sources exceeded!\n"); 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 #ifdef CONFIG_ACPI_PCI
...@@ -1059,7 +1071,6 @@ void __init mp_parse_prt (void) ...@@ -1059,7 +1071,6 @@ void __init mp_parse_prt (void)
{ {
struct list_head *node = NULL; struct list_head *node = NULL;
struct acpi_prt_entry *entry = NULL; struct acpi_prt_entry *entry = NULL;
int vector = 0;
int ioapic = -1; int ioapic = -1;
int ioapic_pin = 0; int ioapic_pin = 0;
int irq = 0; int irq = 0;
...@@ -1104,14 +1115,13 @@ void __init mp_parse_prt (void) ...@@ -1104,14 +1115,13 @@ void __init mp_parse_prt (void)
mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit); mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<<bit);
vector = io_apic_set_pci_routing(ioapic, ioapic_pin, irq); if (!io_apic_set_pci_routing(ioapic, ioapic_pin, irq))
if (vector)
entry->irq = irq; entry->irq = irq;
printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> vector 0x%02x" printk(KERN_DEBUG "%02x:%02x:%02x[%c] -> %d-%d -> IRQ %d\n",
" -> IRQ %d\n", entry->id.segment, entry->id.bus, entry->id.segment, entry->id.bus,
entry->id.device, ('A' + entry->pin), 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); entry->irq);
} }
......
...@@ -612,7 +612,7 @@ acpi_bus_init (void) ...@@ -612,7 +612,7 @@ acpi_bus_init (void)
#ifdef CONFIG_X86 #ifdef CONFIG_X86
/* Ensure the SCI is set to level-triggered, active-low */ /* Ensure the SCI is set to level-triggered, active-low */
if (acpi_ioapic) 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 else
eisa_set_level_irq(acpi_fadt.sci_int); eisa_set_level_irq(acpi_fadt.sci_int);
#endif #endif
......
...@@ -226,6 +226,7 @@ extern void mp_register_lapic_address (u64 address); ...@@ -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_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_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_acpi_legacy_irqs (void);
extern void mp_config_ioapic_for_sci(int irq);
extern void mp_parse_prt (void); extern void mp_parse_prt (void);
#endif /*CONFIG_ACPI_BOOT*/ #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