svn commit: r340261 - head/sys/powerpc/powernv

Justin Hibbits jhibbits at FreeBSD.org
Thu Nov 8 20:31:13 UTC 2018


Author: jhibbits
Date: Thu Nov  8 20:31:12 2018
New Revision: 340261
URL: https://svnweb.freebsd.org/changeset/base/340261

Log:
  powerpc/powernv: Restrict the busdma tag to only POWER8
  
  It seems this tag is causing problems on POWER9 systems.  Since no POWER9 user
  has encountered the problem fixed by r339589 just restrict it to POWER8 for now.
  A better fix will likely be to update powerpc/busdma_machdep.c to handle the
  window correctly.
  
  Reported by:	mmacy, others

Modified:
  head/sys/powerpc/powernv/opal_pci.c

Modified: head/sys/powerpc/powernv/opal_pci.c
==============================================================================
--- head/sys/powerpc/powernv/opal_pci.c	Thu Nov  8 20:17:36 2018	(r340260)
+++ head/sys/powerpc/powernv/opal_pci.c	Thu Nov  8 20:31:12 2018	(r340261)
@@ -433,20 +433,26 @@ opalpci_attach(device_t dev)
 	}
 
 	/* Create the parent DMA tag */
-	err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
-	    1, 0,				/* alignment, bounds */
-	    OPAL_PCI_BUS_SPACE_LOWADDR_32BIT,	/* lowaddr */
-	    BUS_SPACE_MAXADDR_32BIT,		/* highaddr */
-	    NULL, NULL,				/* filter, filterarg */
-	    BUS_SPACE_MAXSIZE,			/* maxsize */
-	    BUS_SPACE_UNRESTRICTED,		/* nsegments */
-	    BUS_SPACE_MAXSIZE,			/* maxsegsize */
-	    0,					/* flags */
-	    NULL, NULL,				/* lockfunc, lockarg */
-	    &sc->ofw_sc.sc_dmat);
-	if (err != 0) {
-		device_printf(dev, "Failed to create DMA tag\n");
-		return (err);
+	/*
+	 * Constrain it to POWER8 PHB (ioda2) for now.  It seems to mess up on
+	 * POWER9 systems.
+	 */
+	if (ofw_bus_is_compatible(dev, "ibm,ioda2-phb")) {
+		err = bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */
+		    1, 0,				/* alignment, bounds */
+		    OPAL_PCI_BUS_SPACE_LOWADDR_32BIT,	/* lowaddr */
+		    BUS_SPACE_MAXADDR_32BIT,		/* highaddr */
+		    NULL, NULL,				/* filter, filterarg */
+		    BUS_SPACE_MAXSIZE,			/* maxsize */
+		    BUS_SPACE_UNRESTRICTED,		/* nsegments */
+		    BUS_SPACE_MAXSIZE,			/* maxsegsize */
+		    0,					/* flags */
+		    NULL, NULL,				/* lockfunc, lockarg */
+		    &sc->ofw_sc.sc_dmat);
+		if (err != 0) {
+			device_printf(dev, "Failed to create DMA tag\n");
+			return (err);
+		}
 	}
 
 	/*


More information about the svn-src-head mailing list