summaryrefslogtreecommitdiffstats
path: root/sys/dev/dpt
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2013-08-12 23:30:01 +0000
committerscottl <scottl@FreeBSD.org>2013-08-12 23:30:01 +0000
commit28bd1409da1e9911c4152b06c5c7b89235e2b17a (patch)
tree34ad11c71aadd28f5ff680b63e3f0fd70956bed5 /sys/dev/dpt
parentc8a53736fe9139a202d17ed7f95389d33326cb61 (diff)
downloadFreeBSD-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/dpt')
-rw-r--r--sys/dev/dpt/dpt_pci.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c
index 150d5cd..f547a22 100644
--- a/sys/dev/dpt/dpt_pci.c
+++ b/sys/dev/dpt/dpt_pci.c
@@ -77,23 +77,17 @@ dpt_pci_attach (device_t dev)
dpt_softc_t * dpt;
int error = 0;
- u_int32_t command;
-
dpt = device_get_softc(dev);
dpt->dev = dev;
dpt_alloc(dev);
- command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1);
-
#ifdef DPT_ALLOW_MMIO
- if ((command & PCIM_CMD_MEMEN) != 0) {
- dpt->io_rid = DPT_PCI_MEMADDR;
- dpt->io_type = SYS_RES_MEMORY;
- dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type,
- &dpt->io_rid, RF_ACTIVE);
- }
+ dpt->io_rid = DPT_PCI_MEMADDR;
+ dpt->io_type = SYS_RES_MEMORY;
+ dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type,
+ &dpt->io_rid, RF_ACTIVE);
#endif
- if (dpt->io_res == NULL && (command & PCIM_CMD_PORTEN) != 0) {
+ if (dpt->io_res == NULL) {
dpt->io_rid = DPT_PCI_IOADDR;
dpt->io_type = SYS_RES_IOPORT;
dpt->io_res = bus_alloc_resource_any(dev, dpt->io_type,
OpenPOWER on IntegriCloud