From: Sepherosa Ziehau Date: Tue, 28 Aug 2012 06:12:10 +0000 (+0800) Subject: acpi/resource: Use legacy_intr_find to detect invalid IRQ configure X-Git-Tag: v3.2.0~239 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/5a9bb009b848bb8155cf7a4d9d55fcc0d59f325c acpi/resource: Use legacy_intr_find to detect invalid IRQ configure --- diff --git a/sys/dev/acpica5/acpi_resource.c b/sys/dev/acpica5/acpi_resource.c index b9c705d..eae8e53 100644 --- a/sys/dev/acpica5/acpi_resource.c +++ b/sys/dev/acpica5/acpi_resource.c @@ -112,6 +112,9 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) { u_int irq; int pol, trig; + enum intr_trigger trigger; + enum intr_polarity polarity; + switch (res->Type) { case ACPI_RESOURCE_TYPE_IRQ: KASSERT(res->Data.Irq.InterruptCount == 1, @@ -131,15 +134,22 @@ acpi_config_intr(device_t dev, ACPI_RESOURCE *res) panic("%s: bad resource type %u", __func__, res->Type); } - if (irq == AcpiGbl_FADT.SciInterrupt) { + if (trig == ACPI_EDGE_SENSITIVE) + trigger = INTR_TRIGGER_EDGE; + else + trigger = INTR_TRIGGER_LEVEL; + + if (pol == ACPI_ACTIVE_HIGH) + polarity = INTR_POLARITY_HIGH; + else + polarity = INTR_POLARITY_LOW; + + if (machintr_legacy_intr_find(irq, trigger, polarity) < 0) { if (bootverbose) - kprintf("acpi_config_intr: Skip SCI config\n"); - return; + kprintf("acpi_config_intr: Skip irq %d config\n", irq); + } else { + BUS_CONFIG_INTR(dev, dev, irq, trigger, polarity); } - - BUS_CONFIG_INTR(dev, dev, irq, (trig == ACPI_EDGE_SENSITIVE) ? - INTR_TRIGGER_EDGE : INTR_TRIGGER_LEVEL, (pol == ACPI_ACTIVE_HIGH) ? - INTR_POLARITY_HIGH : INTR_POLARITY_LOW); } /*