acpi/fadt: Make sure that SCI IRQ is valid
[dragonfly.git] / sys / platform / pc64 / acpica5 / acpi_fadt.c
index 1942138..6918f25 100644 (file)
@@ -184,12 +184,20 @@ acpi_sci_config(void)
 
        KKASSERT(mycpuid == 0);
 
+       if (machintr_legacy_intr_find(acpi_sci_irq,
+           INTR_TRIGGER_CONFORM, INTR_POLARITY_CONFORM) < 0) {
+               kprintf("ACPI FADT: SCI irq %d is invalid, disable\n",
+                   acpi_sci_irq);
+               acpi_sci_irq = -1;
+               return;
+       }
+
        if (acpi_sci_irq < 0)
                return;
 
        if (acpi_sci_trig != INTR_TRIGGER_CONFORM) {
                KKASSERT(acpi_sci_pola != INTR_POLARITY_CONFORM);
-               machintr_intr_config(acpi_sci_irq,
+               machintr_legacy_intr_config(acpi_sci_irq,
                    acpi_sci_trig, acpi_sci_pola);
                return;
        }
@@ -206,7 +214,7 @@ acpi_sci_config(void)
 
                last_cnt = get_interrupt_counter(acpi_sci_irq, 0);
 
-               machintr_intr_config(acpi_sci_irq,
+               machintr_legacy_intr_config(acpi_sci_irq,
                    mode->sci_trig, mode->sci_pola);
 
                sci_desc = register_int(acpi_sci_irq,