From owner-svn-src-head@freebsd.org Sat Oct 31 00:29:27 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB284A22CB7; Sat, 31 Oct 2015 00:29:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8284814C7; Sat, 31 Oct 2015 00:29:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9V0TQxB023041; Sat, 31 Oct 2015 00:29:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9V0TQRM023040; Sat, 31 Oct 2015 00:29:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510310029.t9V0TQRM023040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 31 Oct 2015 00:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290219 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Oct 2015 00:29:27 -0000 Author: adrian Date: Sat Oct 31 00:29:26 2015 New Revision: 290219 URL: https://svnweb.freebsd.org/changeset/base/290219 Log: mips: do mips_sync() on sync operations to uncachable memory. mips24k/mips74k document that we need an explicit SYNC so to order things correctly, even with access to uncachable memory. We were doing calls to SYNC in the cache ops (inv, wbinv) but we weren't doing it for uncachable memory. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:04:44 2015 (r290218) +++ head/sys/mips/mips/busdma_machdep.c Sat Oct 31 00:29:26 2015 (r290219) @@ -1220,11 +1220,12 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus if (STAILQ_FIRST(&map->bpages)) _bus_dmamap_sync_bp(dmat, map, op); - if (dmat->flags & BUS_DMA_COHERENT) - return; - - if (map->flags & DMAMAP_UNCACHEABLE) + if ((dmat->flags & BUS_DMA_COHERENT) || + (map->flags & DMAMAP_UNCACHEABLE)) { + if (op & BUS_DMASYNC_PREWRITE) + mips_sync(); return; + } aligned = (map->flags & DMAMAP_CACHE_ALIGNED) ? 1 : 0;