diff options
author | scottl <scottl@FreeBSD.org> | 2013-08-12 23:30:01 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2013-08-12 23:30:01 +0000 |
commit | 28bd1409da1e9911c4152b06c5c7b89235e2b17a (patch) | |
tree | 34ad11c71aadd28f5ff680b63e3f0fd70956bed5 /sys/dev/ixgb | |
parent | c8a53736fe9139a202d17ed7f95389d33326cb61 (diff) | |
download | FreeBSD-src-28bd1409da1e9911c4152b06c5c7b89235e2b17a.zip FreeBSD-src-28bd1409da1e9911c4152b06c5c7b89235e2b17a.tar.gz |
Update PCI drivers to no longer look at the MEMIO-enabled bit in the PCI
command register. The lazy BAR allocation code in FreeBSD sometimes
disables this bit when it detects a range conflict, and will re-enable
it on demand when a driver allocates the BAR. Thus, the bit is no longer
a reliable indication of capability, and should not be checked. This
results in the elimination of a lot of code from drivers, and also gives
the opportunity to simplify a lot of drivers to use a helper API to set
the busmaster enable bit.
This changes fixes some recent reports of disk controllers and their
associated drives/enclosures disappearing during boot.
Submitted by: jhb
Reviewed by: jfv, marius, achadd, achim
MFC after: 1 day
Diffstat (limited to 'sys/dev/ixgb')
-rw-r--r-- | sys/dev/ixgb/if_ixgb.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/sys/dev/ixgb/if_ixgb.c b/sys/dev/ixgb/if_ixgb.c index 6e46696..2e62c1c 100644 --- a/sys/dev/ixgb/if_ixgb.c +++ b/sys/dev/ixgb/if_ixgb.c @@ -1210,15 +1210,9 @@ ixgb_identify_hardware(struct adapter * adapter) device_t dev = adapter->dev; /* Make sure our PCI config space has the necessary stuff set */ + pci_enable_busmaster(dev); adapter->hw.pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2); - if (!((adapter->hw.pci_cmd_word & PCIM_CMD_BUSMASTEREN) && - (adapter->hw.pci_cmd_word & PCIM_CMD_MEMEN))) { - device_printf(dev, - "Memory Access and/or Bus Master bits were not set!\n"); - adapter->hw.pci_cmd_word |= - (PCIM_CMD_BUSMASTEREN | PCIM_CMD_MEMEN); - pci_write_config(dev, PCIR_COMMAND, adapter->hw.pci_cmd_word, 2); - } + /* Save off the information about this board */ adapter->hw.vendor_id = pci_get_vendor(dev); adapter->hw.device_id = pci_get_device(dev); |