From 0cdba3b7e53c155c1d502db2af05bb17d5189384 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Mon, 7 Aug 2006 19:52:30 +0000 Subject: [PATCH] When a user uses a hint to specify the IRQ for a link device, accept IRQs that aren't listed as valid in the link device's set of possible IRQs. This allows the hints to be used to work around broken BIOSes that don't specify the correct ste of possible IRQs. A warning is issued in the dmesg in this case to be consistent with the $PIR handling code. MFC after: 1 week --- sys/dev/acpica/acpi_pci_link.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index 91a4f5fc2b1..bb39b292cdf 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -941,19 +941,27 @@ acpi_pci_link_choose_irq(device_t dev, struct link *link) KASSERT(!PCI_INTERRUPT_VALID(link->l_irq), ("%s: link already has an IRQ", __func__)); - /* Check for a tunable override and use it if it is valid. */ + /* Check for a tunable override. */ if (ACPI_SUCCESS(acpi_short_name(acpi_get_handle(dev), link_name, sizeof(link_name)))) { snprintf(tunable_buffer, sizeof(tunable_buffer), "hw.pci.link.%s.%d.irq", link_name, link->l_res_index); - if (getenv_int(tunable_buffer, &i) && - PCI_INTERRUPT_VALID(i) && link_valid_irq(link, i)) + if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) { + if (!link_valid_irq(link, i)) + device_printf(dev, + "Warning, IRQ %d is not listed as valid\n", + i); return (i); + } snprintf(tunable_buffer, sizeof(tunable_buffer), "hw.pci.link.%s.irq", link_name); - if (getenv_int(tunable_buffer, &i) && - PCI_INTERRUPT_VALID(i) && link_valid_irq(link, i)) + if (getenv_int(tunable_buffer, &i) && PCI_INTERRUPT_VALID(i)) { + if (!link_valid_irq(link, i)) + device_printf(dev, + "Warning, IRQ %d is not listed as valid\n", + i); return (i); + } } /*