kern/181148: [ata] sas expanders not available in 9.2-RC1 [regression]
John Baldwin
jhb at freebsd.org
Fri Aug 9 18:50:01 UTC 2013
The following reply was made to PR kern/181148; it has been noted by GNATS.
From: John Baldwin <jhb at freebsd.org>
To: "Christopher D. Harrison" <harrison at biostat.wisc.edu>
Cc: bug-followup at freebsd.org,
scottl at freebsd.org,
Doug White <dwhite at freebsd.org>,
re at freebsd.org
Subject: Re: kern/181148: [ata] sas expanders not available in 9.2-RC1 [regression]
Date: Fri, 9 Aug 2013 14:40:35 -0400
On Friday, August 09, 2013 2:15:23 pm Christopher D. Harrison wrote:
> I upgraded the bios and it appears that this fixed the issue. I wish I
> had a board running the old bios version now to test this new code.
> Thanks for all your help in debugging this issue.
> -C
Hmm, so actually a fair number of drivers check the command register in this
fashion which did "work" in older versions. I am working on a sweep of the
tree to fix these, but we will probably want this fix in 9.2 if possible.
Note that the relevant fix in 9.2 fixed a regression in 9.1, so backing out
the PCI change from 9.2 isn't really a win. :(
> On 08/09/13 13:05, John Baldwin wrote:
> > 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
More information about the freebsd-bugs
mailing list