Author: marius
Date: Mon Jul 25 19:11:29 2011
New Revision: 224394
URL: http://svn.freebsd.org/changeset/base/224394

Log:
  MFC: r223984
  
  PCIB_ALLOC_MSIX() may already fail on the first pass, f.e. when the PCI-PCI
  bridge is blacklisted. In that case just return from pci_alloc_msix_method(),
  otherwise we continue without a single MSI-X resource, causing subsequent
  attempts to use the seemingly available resource to fail or when booting
  verbose to NULL-dereference rle->start when trying to print the IRQ in
  pci_alloc_msix_method().
  
  Reviewed by:  jhb

Modified:
  stable/8/sys/dev/pci/pci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/geom/label/   (props changed)

Modified: stable/8/sys/dev/pci/pci.c
==============================================================================
--- stable/8/sys/dev/pci/pci.c  Mon Jul 25 19:06:30 2011        (r224393)
+++ stable/8/sys/dev/pci/pci.c  Mon Jul 25 19:11:29 2011        (r224394)
@@ -1294,8 +1294,11 @@ pci_alloc_msix_method(device_t dev, devi
        for (i = 0; i < max; i++) {
                /* Allocate a message. */
                error = PCIB_ALLOC_MSIX(device_get_parent(dev), child, &irq);
-               if (error)
+               if (error) {
+                       if (i == 0)
+                               return (error);
                        break;
+               }
                resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq,
                    irq, 1);
        }
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to