From bf9ee19d4a2cbeeb0425b5d8ca02a947f2d66561 Mon Sep 17 00:00:00 2001 From: jhb Date: Tue, 24 Jun 2014 20:35:20 +0000 Subject: [PATCH] MFC 253392: Workaround some broken BIOSes that specify edge-sensitive but active-low settings for ACPI-enumerated serial ports by forcing any IRQs that use an ISA IRQ value with these settings to active-high instead of active-low. This is known to occur with the BIOS on an Intel D2500CCE motherboard. Approved by: re (gjb) git-svn-id: svn://svn.freebsd.org/base/releng/9.3@267841 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/acpica/acpi_resource.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c index ce6732f16..ac6f25ca8 100644 --- a/sys/dev/acpica/acpi_resource.c +++ b/sys/dev/acpica/acpi_resource.c @@ -135,6 +135,17 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) default: panic("%s: bad resource type %u", __func__, res->Type); } + +#if defined(__amd64__) || defined(__i386__) + /* + * XXX: Certain BIOSes have buggy AML that specify an IRQ that is + * edge-sensitive and active-lo. However, edge-sensitive IRQs + * should be active-hi. Force IRQs with an ISA IRQ value to be + * active-hi instead. + */ + if (irq < 16 && trig == ACPI_EDGE_SENSITIVE && pol == ACPI_ACTIVE_LOW) + pol = ACPI_ACTIVE_HIGH; +#endif BUS_CONFIG_INTR(dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? INTR_POLARITY_HIGH : INTR_POLARITY_LOW); -- 2.42.0