Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 May 2012 13:41:12 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r235833 - head/sys/dev/pci
Message-ID:  <201205231341.q4NDfCRW075645@svn.freebsd.org>

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



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