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 ( ...@@ -409,28 +409,38 @@ acpi_parse_nmi_src (
void __init void __init
acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger) acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger)
{ {
unsigned char mask = 1 << (irq & 7); unsigned int mask = 1 << irq;
unsigned int port = 0x4d0 + (irq >> 3); unsigned int old, new;
unsigned char val = inb(port);
/* Real old ELCR mask */
printk(PREFIX "IRQ%d SCI:", irq); old = inb(0x4d0) | (inb(0x4d1) << 8);
if (!(val & mask)) {
printk(" Edge");
if (trigger == 3) { /*
printk(" set to Level"); * If we use ACPI to set PCI irq's, then we should clear ELCR
outb(val | mask, port); * since we will set it correctly as we enable the PCI irq
} * routing.
} else { */
printk(" Level"); new = acpi_noirq ? old : 0;
if (trigger == 1) { /*
printk(" set to Edge"); * Update SCI information in the ELCR, it isn't in the PCI
outb(val & ~mask, port); * routing tables..
} */
switch (trigger) {
case 1: /* Edge - clear */
new &= ~mask;
break;
case 3: /* Level - set */
new |= mask;
break;
} }
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 ( ...@@ -685,6 +685,9 @@ acpi_pci_link_add (
acpi_link.count++; acpi_link.count++;
end: end:
/* disable all links -- to be activated on use */
acpi_ut_evaluate_object(link->handle, "_DIS", 0, NULL);
if (result) if (result)
kfree(link); 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