svn commit: r235833 - head/sys/dev/pci

John Baldwin jhb at FreeBSD.org
Wed May 23 13:41:13 UTC 2012


Author: jhb
Date: Wed May 23 13:41:12 2012
New Revision: 235833
URL: http://svn.freebsd.org/changeset/base/235833

Log:
  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.
  
  Tested by:	Olivier Cinquin  ocinquin uci edu
  MFC after:	3 days

Modified:
  head/sys/dev/pci/pci.c

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Wed May 23 13:39:46 2012	(r235832)
+++ head/sys/dev/pci/pci.c	Wed May 23 13:41:12 2012	(r235833)
@@ -4260,7 +4260,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) {
@@ -4287,7 +4287,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));
 	}


More information about the svn-src-all mailing list