summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2007-07-29 02:44:41 +0000
committermarcel <marcel@FreeBSD.org>2007-07-29 02:44:41 +0000
commitcf090ffcf768e1064081726cc1bbf55cdbf9e1d1 (patch)
tree86c105f950e87b84e2c8473c4f5396bc7daf947d /sys/dev/pci
parent26ba4b61a64d476d54fff01a6f4345820fbaf42f (diff)
downloadFreeBSD-src-cf090ffcf768e1064081726cc1bbf55cdbf9e1d1.zip
FreeBSD-src-cf090ffcf768e1064081726cc1bbf55cdbf9e1d1.tar.gz
In pci_alloc_map(), restore the original value of the BAR for
the duration of the function. The device we would otherwise have left in an useless state may just as well be the low-level console. When booting verbose, we do need it addressable if we want to avoid a MCA. Approved by: re (kensmith)
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 2458863..d8b8ab0 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -3265,6 +3265,14 @@ pci_alloc_map(device_t dev, device_t child, int type, int *rid,
map |= (pci_addr_t)pci_read_config(child, *rid + 4, 4) << 32;
if (pci_mapbase(testval) == 0)
goto out;
+
+ /*
+ * Restore the original value of the BAR. We may have reprogrammed
+ * the BAR of the low-level console device and when booting verbose,
+ * we need the console device addressable.
+ */
+ pci_write_config(child, *rid, map, 4);
+
if (PCI_BAR_MEM(testval)) {
if (type != SYS_RES_MEMORY) {
if (bootverbose)
OpenPOWER on IntegriCloud