Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Jul 2011 19:11:29 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224394 - stable/8/sys/dev/pci
Message-ID:  <201107251911.p6PJBTX8073162@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107251911.p6PJBTX8073162>