Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757571AbcJXSF4 (ORCPT ); Mon, 24 Oct 2016 14:05:56 -0400 Received: from mga09.intel.com ([134.134.136.24]:63836 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757539AbcJXSFu (ORCPT ); Mon, 24 Oct 2016 14:05:50 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="776998147" Subject: [net-next PATCH RFC 06/26] arch/blackfin: Add option to skip sync on DMA map From: Alexander Duyck To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: brouer@redhat.com, davem@davemloft.net, Steven Miao Date: Mon, 24 Oct 2016 08:04:58 -0400 Message-ID: <20161024120458.16276.10950.stgit@ahduyck-blue-test.jf.intel.com> In-Reply-To: <20161024115737.16276.71059.stgit@ahduyck-blue-test.jf.intel.com> References: <20161024115737.16276.71059.stgit@ahduyck-blue-test.jf.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1166 Lines: 35 The use of DMA_ATTR_SKIP_CPU_SYNC was not consistent across all of the DMA APIs in the arch/arm folder. This change is meant to correct that so that we get consistent behavior. Cc: Steven Miao Signed-off-by: Alexander Duyck --- arch/blackfin/kernel/dma-mapping.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index 53fbbb6..ed9a6a8 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -133,6 +133,10 @@ static void bfin_dma_sync_sg_for_device(struct device *dev, for_each_sg(sg_list, sg, nelems, i) { sg->dma_address = (dma_addr_t) sg_virt(sg); + + if (attrs & DMA_ATTR_SKIP_CPU_SYNC) + continue; + __dma_sync(sg_dma_address(sg), sg_dma_len(sg), direction); } } @@ -143,7 +147,8 @@ static dma_addr_t bfin_dma_map_page(struct device *dev, struct page *page, { dma_addr_t handle = (dma_addr_t)(page_address(page) + offset); - _dma_sync(handle, size, dir); + if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC)) + _dma_sync(handle, size, dir); return handle; }