Don't assume that the current setting (_CRS) of a PCI link device is

correct.  Instead, check it against the possible settings (_PRS) when
the link is probed.  This is important when using APIC mode but link
devices still have PIC mode settings.  This is also what Linux does.

Additional prodding by:	Len Brown len dot brown at intel dot com
This commit is contained in:
John Baldwin 2004-05-28 17:31:32 +00:00
parent 1c8329632e
commit 91c14f698c

View File

@ -48,7 +48,6 @@ struct acpi_pci_link_entry {
TAILQ_ENTRY(acpi_pci_link_entry) links;
ACPI_HANDLE handle;
UINT8 current_irq;
UINT8 initial_irq;
ACPI_RESOURCE possible_resources;
UINT8 number_of_interrupts;
UINT8 interrupts[MAX_POSSIBLE_INTERRUPTS];
@ -73,6 +72,9 @@ static struct acpi_prt_entries acpi_prt_entries;
static int irq_penalty[MAX_ACPI_INTERRUPTS];
static int acpi_pci_link_is_valid_irq(struct acpi_pci_link_entry *link,
UINT8 irq);
#define ACPI_STA_PRESENT 0x00000001
#define ACPI_STA_ENABLE 0x00000002
#define ACPI_STA_SHOWINUI 0x00000004
@ -382,7 +384,12 @@ acpi_pci_link_add_link(ACPI_HANDLE handle, struct acpi_prt_entry *entry)
acpi_name(handle), AcpiFormatException(error)));
}
link->initial_irq = link->current_irq;
if (!acpi_pci_link_is_valid_irq(link, link->current_irq)) {
ACPI_DEBUG_PRINT((ACPI_DB_WARN,
"initial IRQ %u is invalid for link %s\n",
link->current_irq, acpi_name(handle)));
link->current_irq = 0;
}
error = AcpiGetPossibleResources(handle, &buf);
if (ACPI_FAILURE(error)) {
@ -525,11 +532,6 @@ acpi_pci_link_is_valid_irq(struct acpi_pci_link_entry *link, UINT8 irq)
if (link->interrupts[i] == irq)
return (1);
}
/* allow initial IRQ as valid one. */
if (link->initial_irq == irq)
return (1);
return (0);
}