Don't panic if we're trying to disestablish an MSI but the hardware is gone.
authorkettenis <kettenis@openbsd.org>
Sat, 19 Apr 2014 11:53:42 +0000 (11:53 +0000)
committerkettenis <kettenis@openbsd.org>
Sat, 19 Apr 2014 11:53:42 +0000 (11:53 +0000)
tested by & ok mlarkin@

sys/arch/amd64/pci/pci_machdep.c
sys/arch/i386/pci/pci_machdep.c

index 9fac42f..4098fa2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pci_machdep.c,v 1.58 2013/11/06 10:40:36 mpi Exp $    */
+/*     $OpenBSD: pci_machdep.c,v 1.59 2014/04/19 11:53:42 kettenis Exp $       */
 /*     $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $     */
 
 /*-
@@ -375,9 +375,8 @@ msi_delroute(struct pic *pic, struct cpu_info *ci, int pin, int vec, int type)
        pcireg_t reg;
        int off;
 
-       if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, &reg) == 0)
-               panic("%s: no msi capability", __func__);
-       pci_conf_write(pc, tag, off, reg & ~PCI_MSI_MC_MSIE);
+       if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, &reg))
+               pci_conf_write(pc, tag, off, reg & ~PCI_MSI_MC_MSIE);
 }
 
 int
index d7b394a..cc3a24f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pci_machdep.c,v 1.77 2013/11/06 10:40:36 mpi Exp $    */
+/*     $OpenBSD: pci_machdep.c,v 1.78 2014/04/19 11:53:42 kettenis Exp $       */
 /*     $NetBSD: pci_machdep.c,v 1.28 1997/06/06 23:29:17 thorpej Exp $ */
 
 /*-
@@ -859,10 +859,8 @@ pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie)
                pcireg_t reg;
                int off;
                
-               if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, &reg) == 0)
-                       panic("%s: no msi capability", __func__);
-
-               pci_conf_write(pc, tag, off, reg &= ~PCI_MSI_MC_MSIE);
+               if (pci_get_capability(pc, tag, PCI_CAP_MSI, &off, &reg))
+                       pci_conf_write(pc, tag, off, reg &= ~PCI_MSI_MC_MSIE);
 
                apic_maxlevel[ih->ih_vec] = 0;
                apic_intrhand[ih->ih_vec] = NULL;