From owner-svn-src-projects@FreeBSD.ORG Sat Nov 9 20:11:21 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id EE795272; Sat, 9 Nov 2013 20:11:21 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D9E4E20D7; Sat, 9 Nov 2013 20:11:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rA9KBL6g022450; Sat, 9 Nov 2013 20:11:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rA9KBLLK022449; Sat, 9 Nov 2013 20:11:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201311092011.rA9KBLLK022449@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 9 Nov 2013 20:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r257897 - projects/altix2/sys/kern X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Nov 2013 20:11:22 -0000 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; }