aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/mly/mly.c
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2013-08-12 23:30:01 +0000
committerScott Long <scottl@FreeBSD.org>2013-08-12 23:30:01 +0000
commitc68534f1d5bab4ad466384c4fb9bb2956811e8b9 (patch)
tree34ad11c71aadd28f5ff680b63e3f0fd70956bed5 /sys/dev/mly/mly.c
parent4dc63104ae991922e7116022661fb3c7f366dd33 (diff)
downloadsrc-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/mly/mly.c')
-rw-r--r--sys/dev/mly/mly.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/sys/dev/mly/mly.c b/sys/dev/mly/mly.c
index a5c568b10433..a58b21b8f08e 100644
--- a/sys/dev/mly/mly.c
+++ b/sys/dev/mly/mly.c
@@ -333,7 +333,6 @@ static int
mly_pci_attach(struct mly_softc *sc)
{
int i, error;
- u_int32_t command;
debug_called(1);
@@ -342,21 +341,8 @@ mly_pci_attach(struct mly_softc *sc)
/*
* Verify that the adapter is correctly set up in PCI space.
- *
- * XXX we shouldn't do this; the PCI code should.
*/
- command = pci_read_config(sc->mly_dev, PCIR_COMMAND, 2);
- command |= PCIM_CMD_BUSMASTEREN;
- pci_write_config(sc->mly_dev, PCIR_COMMAND, command, 2);
- command = pci_read_config(sc->mly_dev, PCIR_COMMAND, 2);
- if (!(command & PCIM_CMD_BUSMASTEREN)) {
- mly_printf(sc, "can't enable busmaster feature\n");
- goto fail;
- }
- if ((command & PCIM_CMD_MEMEN) == 0) {
- mly_printf(sc, "memory window not available\n");
- goto fail;
- }
+ pci_enable_busmaster(sc->mly_dev);
/*
* Allocate the PCI register window.