svn commit: r257897 - projects/altix2/sys/kern

Marcel Moolenaar marcel at FreeBSD.org
Sat Nov 9 20:11:22 UTC 2013


Author: marcel
Date: Sat Nov  9 20:11:21 2013
New Revision: 257897
URL: http://svnweb.freebsd.org/changeset/base/257897

Log:
  Fix busdma_md_unload() to recursively call devices up the
  device tree. When we map we start at the root and recurse
  down to the leaf device. When we unmap, we go the reverse
  direction.
  
  This fix actually has us call the unmap function of the
  PCI bridge, which means we now free up I/O MMU mappings.
  
  This and previous few commits were all done from the Altix
  itself. Looking good...

Modified:
  projects/altix2/sys/kern/subr_busdma.c

Modified: projects/altix2/sys/kern/subr_busdma.c
==============================================================================
--- projects/altix2/sys/kern/subr_busdma.c	Sat Nov  9 20:09:02 2013	(r257896)
+++ projects/altix2/sys/kern/subr_busdma.c	Sat Nov  9 20:11:21 2013	(r257897)
@@ -445,10 +445,15 @@ _busdma_iommu_unmap(device_t dev, struct
 	device_t bus;
 	int error;
 
-	bus = device_get_parent(dev);
 	error = 0;
 	TAILQ_FOREACH(seg, &md->md_seg, mds_chain) {
-		error = BUSDMA_IOMMU_UNMAP(bus, dev, md, seg->mds_idx);
+		bus = device_get_parent(dev);
+		while (bus != root_bus) {
+			error = BUSDMA_IOMMU_UNMAP(bus, dev, md, seg->mds_idx);
+			if (error)
+				break;
+			bus = device_get_parent(bus);
+		}
 		if (error)
 			break;
 	}


More information about the svn-src-projects mailing list