Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 May 2012 16:30:51 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r236320 - stable/9/sys/dev/pci
Message-ID:  <201205301630.q4UGUpgc062405@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed May 30 16:30:51 2012
New Revision: 236320
URL: http://svn.freebsd.org/changeset/base/236320

Log:
  MFC 235833:
  Only check to see if a memory resource is a PCI ROM BAR when activating
  and deactivating PCI resources.  Previously, if a device had more than
  48 MSI interrupts, then activating message 48 (which has a rid == PCIR_BIOS)
  would incorrectly try to enable the PCI ROM BAR.

Modified:
  stable/9/sys/dev/pci/pci.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)
  stable/9/sys/dev/   (props changed)
  stable/9/sys/dev/e1000/   (props changed)
  stable/9/sys/dev/ixgbe/   (props changed)
  stable/9/sys/fs/   (props changed)
  stable/9/sys/fs/ntfs/   (props changed)
  stable/9/sys/modules/   (props changed)

Modified: stable/9/sys/dev/pci/pci.c
==============================================================================
--- stable/9/sys/dev/pci/pci.c	Wed May 30 16:13:34 2012	(r236319)
+++ stable/9/sys/dev/pci/pci.c	Wed May 30 16:30:51 2012	(r236320)
@@ -4189,7 +4189,7 @@ pci_activate_resource(device_t dev, devi
 	if (device_get_parent(child) == dev) {
 		/* Device ROMs need their decoding explicitly enabled. */
 		dinfo = device_get_ivars(child);
-		if (PCIR_IS_BIOS(&dinfo->cfg, rid))
+		if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid))
 			pci_write_bar(child, pci_find_bar(child, rid),
 			    rman_get_start(r) | PCIM_BIOS_ENABLE);
 		switch (type) {
@@ -4216,7 +4216,7 @@ pci_deactivate_resource(device_t dev, de
 	/* Disable decoding for device ROMs. */	
 	if (device_get_parent(child) == dev) {
 		dinfo = device_get_ivars(child);
-		if (PCIR_IS_BIOS(&dinfo->cfg, rid))
+		if (type == SYS_RES_MEMORY && PCIR_IS_BIOS(&dinfo->cfg, rid))
 			pci_write_bar(child, pci_find_bar(child, rid),
 			    rman_get_start(r));
 	}



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