svn commit: r224395 - stable/7/sys/dev/pci

Marius Strobl marius at FreeBSD.org
Mon Jul 25 19:11:30 UTC 2011


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

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/7/sys/dev/pci/pci.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c	Mon Jul 25 19:11:29 2011	(r224394)
+++ stable/7/sys/dev/pci/pci.c	Mon Jul 25 19:11:29 2011	(r224395)
@@ -1243,8 +1243,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);
 	}


More information about the svn-src-stable-7 mailing list