Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Nov 2018 20:31:12 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r340261 - head/sys/powerpc/powernv
Message-ID:  <201811082031.wA8KVCeh049287@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
+		}
 	}
 
 	/*



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