summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2012-05-23 13:41:12 +0000
committerjhb <jhb@FreeBSD.org>2012-05-23 13:41:12 +0000
commit19998841a50d345cbb455483d496c3877b32de20 (patch)
treebd4c8d374e8d3717e4dfd13d1e22a059d99f99a0
parentbe5bfc030892300b830d9ec66dedf914f18f7c56 (diff)
downloadFreeBSD-src-19998841a50d345cbb455483d496c3877b32de20.zip
FreeBSD-src-19998841a50d345cbb455483d496c3877b32de20.tar.gz
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
-rw-r--r--sys/dev/pci/pci.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index efb0b58..6503421 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -4260,7 +4260,7 @@ pci_activate_resource(device_t dev, device_t child, int type, int rid,
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, device_t child, int type,
/* 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));
}
OpenPOWER on IntegriCloud