From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 20:55:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3995DC7B; Sun, 16 Nov 2014 20:55:52 +0000 (UTC) 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)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2629F880; Sun, 16 Nov 2014 20:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAGKtquP098429; Sun, 16 Nov 2014 20:55:52 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAGKtqC0098428; Sun, 16 Nov 2014 20:55:52 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201411162055.sAGKtqC0098428@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 16 Nov 2014 20:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274602 - head/sys/arm/arm 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.18-1 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: Sun, 16 Nov 2014 20:55:52 -0000 Author: ian Date: Sun Nov 16 20:55:51 2014 New Revision: 274602 URL: https://svnweb.freebsd.org/changeset/base/274602 Log: Do not do a cache invalidate on a PREREAD sync that is also a PREWRITE sync. The PREWRITE handling does a writeback of any dirty cachelines, so there's no danger of an eviction during the DMA corrupting the buffer. There will be an invalidate done during POSTREAD, so doing it before the read too is wasted time. Modified: head/sys/arm/arm/busdma_machdep-v6.c Modified: head/sys/arm/arm/busdma_machdep-v6.c ============================================================================== --- head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:42:30 2014 (r274601) +++ head/sys/arm/arm/busdma_machdep-v6.c Sun Nov 16 20:55:51 2014 (r274602) @@ -1345,7 +1345,7 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } - if (op & BUS_DMASYNC_PREREAD) { + if ((op & BUS_DMASYNC_PREREAD) && !(op & BUS_DMASYNC_PREWRITE)) { bpage = STAILQ_FIRST(&map->bpages); while (bpage != NULL) { cpu_dcache_inv_range((vm_offset_t)bpage->vaddr,