diff options
author | Scott Long <scottl@FreeBSD.org> | 2013-08-12 23:30:01 +0000 |
---|---|---|
committer | Scott Long <scottl@FreeBSD.org> | 2013-08-12 23:30:01 +0000 |
commit | c68534f1d5bab4ad466384c4fb9bb2956811e8b9 (patch) | |
tree | 34ad11c71aadd28f5ff680b63e3f0fd70956bed5 /sys/dev/twa | |
parent | 4dc63104ae991922e7116022661fb3c7f366dd33 (diff) | |
download | src-c68534f1d5bab4ad466384c4fb9bb2956811e8b9.tar.gz src-c68534f1d5bab4ad466384c4fb9bb2956811e8b9.zip |
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
Notes
Notes:
svn path=/head/; revision=254263
Diffstat (limited to 'sys/dev/twa')
-rw-r--r-- | sys/dev/twa/tw_osl_freebsd.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/dev/twa/tw_osl_freebsd.c b/sys/dev/twa/tw_osl_freebsd.c index b2284f898920..8b5626723f22 100644 --- a/sys/dev/twa/tw_osl_freebsd.c +++ b/sys/dev/twa/tw_osl_freebsd.c @@ -284,7 +284,6 @@ static TW_INT32 twa_attach(device_t dev) { struct twa_softc *sc = device_get_softc(dev); - TW_UINT32 command; TW_INT32 bar_num; TW_INT32 bar0_offset; TW_INT32 bar_size; @@ -323,22 +322,8 @@ twa_attach(device_t dev) OID_AUTO, "driver_version", CTLFLAG_RD, TW_OSL_DRIVER_VERSION_STRING, 0, "TWA driver version"); - /* Make sure we are going to be able to talk to this board. */ - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_PORTEN) == 0) { - tw_osli_printf(sc, "error = %d", - TW_CL_SEVERITY_ERROR_STRING, - TW_CL_MESSAGE_SOURCE_FREEBSD_DRIVER, - 0x2001, - "Register window not available", - ENXIO); - tw_osli_free_resources(sc); - return(ENXIO); - } - /* Force the busmaster enable bit on, in case the BIOS forgot. */ - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); + pci_enable_busmaster(dev); /* Allocate the PCI register window. */ if ((error = tw_cl_get_pci_bar_info(sc->device_id, TW_CL_BAR_TYPE_MEM, |