Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Aug 2013 18:20:01 GMT
From:      "Christopher D. Harrison" <harrison@biostat.wisc.edu>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/181148: [ata] sas expanders not available in 9.2-RC1 [regression]
Message-ID:  <201308091820.r79IK1PO051573@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: "Christopher D. Harrison" <harrison@biostat.wisc.edu>
To: John Baldwin <jhb@freebsd.org>
Cc: bug-followup@freebsd.org, scottl@freebsd.org,
 Doug White <dwhite@freebsd.org>
Subject: Re: kern/181148: [ata] sas expanders not available in 9.2-RC1
 [regression]
Date: Fri, 09 Aug 2013 13:15:23 -0500

 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
 
 
 
 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);
 >
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308091820.r79IK1PO051573>