Commit b3436fb3 authored by Linus Torvalds's avatar Linus Torvalds Committed by Linus Torvalds

acpi: disable PCI links at boot again, fix ELCR

Len Brown convinced me that the problem with disabling
PCI routing entries wasn't the disable as much as the
fact that ELCR needs to be updated when removing the PCI
routing. So this reverts the previous cset and updates
ELCR as suggested by Len.
parent c358ee99
......@@ -409,28 +409,38 @@ acpi_parse_nmi_src (
void __init
acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
{
unsigned char mask = 1 << (irq & 7);
unsigned int port = 0x4d0 + (irq >> 3);
unsigned char val = inb(port);
unsigned int mask = 1 << irq;
unsigned int old, new;
/* Real old ELCR mask */
old = inb(0x4d0) | (inb(0x4d1) << 8);
printk(PREFIX "IRQ%d SCI:", irq);
if (!(val & mask)) {
printk(" Edge");
/*
* If we use ACPI to set PCI irq's, then we should clear ELCR
* since we will set it correctly as we enable the PCI irq
* routing.
*/
new = acpi_noirq ? old : 0;
if (trigger == 3) {
printk(" set to Level");
outb(val | mask, port);
/*
* Update SCI information in the ELCR, it isn't in the PCI
* routing tables..
*/
switch (trigger) {
case 1: /* Edge - clear */
new &= ~mask;
break;
case 3: /* Level - set */
new |= mask;
break;
}
} else {
printk(" Level");
if (trigger == 1) {
printk(" set to Edge");
outb(val & ~mask, port);
}
}
printk(" Trigger.\n");
if (old == new)
return;
printk(PREFIX "setting ELCR to %04x (from %04x)\n", new, old);
outb(new, 0x4d0);
outb(new >> 8, 0x4d1);
}
......
......@@ -685,6 +685,9 @@ acpi_pci_link_add (
acpi_link.count++;
end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
if (result)
kfree(link);
......
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