Date: Fri, 9 Aug 2013 18:10:01 GMT From: John Baldwin <jhb@freebsd.org> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/181148: [ata] sas expanders not available in 9.2-RC1 [regression] Message-ID: <201308091810.r79IA1kq048945@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/181148; it has been noted by GNATS. From: John Baldwin <jhb@freebsd.org> To: bug-followup@freebsd.org, harrison@biostat.wisc.edu Cc: scottl@freebsd.org, Doug White <dwhite@freebsd.org> Subject: Re: kern/181148: [ata] sas expanders not available in 9.2-RC1 [regression] Date: Fri, 9 Aug 2013 14:05:46 -0400 The mps(4) driver is just broken. 9.2 includes a fix that if your BIOS writers can't do simple math and allocate conflicting resources, it disables decoding of the device where it finds the conflict. Later if a device driver expicitly asks to use that resource, the PCI bus will allocate a fresh resource range that doesn't conflict if possible. If it suceeds it re-enables decoding. The mps(4) driver checks to see if decoding is enabled before it calls bus_alloc_resource(). It should not. It should assume that if bus_alloc_resource() succeeds, everything is fine and decoding will be enabled. Try this fix: Index: mps_pci.c =================================================================== --- mps_pci.c (revision 254147) +++ mps_pci.c (working copy) @@ -183,7 +183,6 @@ mps_pci_attach(device_t dev) { struct mps_softc *sc; struct mps_ident *m; - uint16_t command; int error; sc = device_get_softc(dev); @@ -193,18 +192,7 @@ mps_pci_attach(device_t dev) sc->mps_flags = m->flags; /* Twiddle basic PCI config bits for a sanity check */ - command = pci_read_config(dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - command = pci_read_config(dev, PCIR_COMMAND, 2); - if ((command & PCIM_CMD_BUSMASTEREN) == 0) { - mps_printf(sc, "Cannot enable PCI busmaster\n"); - return (ENXIO); - } - if ((command & PCIM_CMD_MEMEN) == 0) { - mps_printf(sc, "PCI memory window not available\n"); - return (ENXIO); - } + pci_enable_busmaster(dev); /* Allocate the System Interface Register Set */ sc->mps_regs_rid = PCIR_BAR(1); -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308091810.r79IA1kq048945>