PERFORCE change 207047 for review

John Baldwin jhb at FreeBSD.org
Tue Feb 28 20:18:02 UTC 2012


http://p4web.freebsd.org/@@207047?ac=10

Change 207047 by jhb at jhb_jhbbsd on 2012/02/28 20:17:48

	Don't create DMA tags on PCI busses behind a PCI-PCI bridge.

Affected files ...

.. //depot/projects/pci/sys/dev/pci/pci.c#28 edit

Differences ...

==== //depot/projects/pci/sys/dev/pci/pci.c#28 (text+ko) ====

@@ -3175,15 +3175,18 @@
 	if (bootverbose)
 		device_printf(dev, "domain=%d, physical bus=%d\n",
 		    domain, busno);
-	error = bus_dma_tag_create(bus_get_dma_tag(dev), 1, PCI_DMA_BOUNDARY,
-	    BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, BUS_SPACE_MAXSIZE,
-	    BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE, 0, NULL, NULL,
-	    &sc->sc_dma_tag);
-	if (error)
-		device_printf(dev, "Failed to create DMA tag: %d\n", error);
-	else
-		sc->sc_dma_tag_valid = 1;
-
+	if (device_get_devclass(device_get_parent(device_get_parent(dev))) !=
+	    devclass_find("pci")) {
+		error = bus_dma_tag_create(bus_get_dma_tag(dev), 1,
+		    PCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR,
+		    NULL, NULL, BUS_SPACE_MAXSIZE, BUS_SPACE_UNRESTRICTED,
+		    BUS_SPACE_MAXSIZE, 0, NULL, NULL, &sc->sc_dma_tag);
+		if (error)
+			device_printf(dev, "Failed to create DMA tag: %d\n",
+			    error);
+		else
+			sc->sc_dma_tag_valid = 1;
+	}
 	return (0);
 }
 


More information about the p4-projects mailing list