x86: Stop guessing IOAPIC routes
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 28 Mar 2014 00:49:12 +0000 (17:49 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Sat, 29 Mar 2014 01:17:06 +0000 (18:17 -0700)
That hasn't worked on hardware yet.

Also fixes dumb bug in msi_mask_irq(): it could be called without the
MSI cap.

kern/arch/x86/ioapic.c
kern/arch/x86/msi.c

index 73c13a6..0a5809e 100644 (file)
@@ -245,15 +245,8 @@ static int acpi_make_rdt(int tbdf, int irq, int busno, int devno)
                        gsi_irq = irq;
                } else {
                        /* Need to query ACPI at some point to handle this */
-                       printk("Non-ISA IRQ %d not found in MADT", irq);
-                       if (BUSTYPE(tbdf) != BusPCI) {
-                               printk(", aborting...\n");
-                               return -1;
-                       }
-                       /* Going to just guess some values for PCI */
-                       printk(", guessing...\n");
-                       lo = IPlow | TMlevel;
-                       gsi_irq = irq;
+                       printk("Non-ISA IRQ %d not found in MADT, aborting", irq);
+                       return -1;
                }
        }
        ioapic_nr = acpi_irq2ioapic(gsi_irq);
index cbb2be5..575679d 100644 (file)
@@ -224,7 +224,8 @@ void msi_mask_irq(struct irq_handler *irq_h, int apic_vector)
        struct pci_device *p = (struct pci_device*)irq_h->dev_private;
        unsigned int c, f;
        c = msicap(p);
-       assert(c);
+       if (!c)
+               return;
 
        f = pcidev_read16(p, c + 2);
        pcidev_write16(p, c + 2, f & ~Msienable);