diff options
author | jhb <jhb@FreeBSD.org> | 2004-05-28 17:31:32 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-05-28 17:31:32 +0000 |
commit | b37201f805ae21b7d31c476e7c244c3352f8506a (patch) | |
tree | 0fba7c37628c6b39aa04f664ef43cf2c09a916c7 | |
parent | 67b0af2d89cbb9ad02ca489ff6320ffe6bf878d5 (diff) | |
download | FreeBSD-src-b37201f805ae21b7d31c476e7c244c3352f8506a.zip FreeBSD-src-b37201f805ae21b7d31c476e7c244c3352f8506a.tar.gz |
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
-rw-r--r-- | sys/dev/acpica/acpi_pci_link.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 400aa14..630d11f 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -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); } |