From: Alexander Duyck <alexander.h.duyck@intel.com>
To: linux-mm@kvack.org, akpm@linux-foundation.org
Cc: Max Filippov <jcmvbkbc@gmail.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [mm PATCH v2 22/26] arch/xtensa: Add option to skip DMA sync as a part of mapping
Date: Wed, 02 Nov 2016 07:15:52 -0400 [thread overview]
Message-ID: <20161102111549.79519.59449.stgit@ahduyck-blue-test.jf.intel.com> (raw)
In-Reply-To: <20161102111031.79519.14741.stgit@ahduyck-blue-test.jf.intel.com>
This change allows us to pass DMA_ATTR_SKIP_CPU_SYNC which allows us to
avoid invoking cache line invalidation if the driver will just handle it
via a sync_for_cpu or sync_for_device call.
Cc: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
---
arch/xtensa/kernel/pci-dma.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index 1e68806..6a16dec 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -189,7 +189,9 @@ static dma_addr_t xtensa_map_page(struct device *dev, struct page *page,
{
dma_addr_t dma_handle = page_to_phys(page) + offset;
- xtensa_sync_single_for_device(dev, dma_handle, size, dir);
+ if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
+ xtensa_sync_single_for_device(dev, dma_handle, size, dir);
+
return dma_handle;
}
@@ -197,7 +199,8 @@ static void xtensa_unmap_page(struct device *dev, dma_addr_t dma_handle,
size_t size, enum dma_data_direction dir,
unsigned long attrs)
{
- xtensa_sync_single_for_cpu(dev, dma_handle, size, dir);
+ if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
+ xtensa_sync_single_for_cpu(dev, dma_handle, size, dir);
}
static int xtensa_map_sg(struct device *dev, struct scatterlist *sg,
next prev parent reply other threads:[~2016-11-02 17:19 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 11:12 [mm PATCH v2 00/26] Add support for DMA writable pages being writable by the network stack Alexander Duyck
2016-11-02 11:12 ` [mm PATCH v2 01/26] swiotlb: Drop unused functions swiotlb_map_sg and swiotlb_unmap_sg Alexander Duyck
2016-11-03 14:14 ` Christoph Hellwig
2016-11-03 14:29 ` Konrad Rzeszutek Wilk
2016-11-03 14:45 ` Christoph Hellwig
2016-11-03 15:02 ` Duyck, Alexander H
2016-11-02 11:12 ` [mm PATCH v2 02/26] swiotlb-xen: Enforce return of DMA_ERROR_CODE in mapping function Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 03/26] swiotlb: Add support for DMA_ATTR_SKIP_CPU_SYNC Alexander Duyck
2016-11-05 19:39 ` Konrad Rzeszutek Wilk
2016-11-05 23:13 ` Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 04/26] arch/arc: Add option to skip sync on DMA mapping Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 05/26] arch/arm: Add option to skip sync on DMA map and unmap Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 06/26] arch/avr32: Add option to skip sync on DMA map Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 07/26] arch/blackfin: " Alexander Duyck
2016-11-02 11:13 ` [mm PATCH v2 08/26] arch/c6x: Add option to skip sync on DMA map and unmap Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 09/26] arch/frv: Add option to skip sync on DMA map Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 10/26] arch/hexagon: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 11/26] arch/m68k: " Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 12/26] arch/metag: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 13/26] arch/microblaze: " Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 14/26] arch/mips: " Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 15/26] arch/nios2: " Alexander Duyck
2016-11-02 11:14 ` [mm PATCH v2 16/26] arch/openrisc: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-11-02 11:15 ` [mm PATCH v2 17/26] arch/parisc: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-11-02 11:15 ` [mm PATCH v2 18/26] arch/powerpc: Add option to skip DMA sync as a part of mapping Alexander Duyck
2016-11-04 3:16 ` Michael Ellerman
2016-11-02 11:15 ` [mm PATCH v2 19/26] arch/sh: " Alexander Duyck
2016-11-02 11:15 ` [mm PATCH v2 20/26] arch/sparc: Add option to skip DMA sync as a part of map and unmap Alexander Duyck
2016-11-02 11:15 ` [mm PATCH v2 21/26] arch/tile: " Alexander Duyck
2016-11-02 11:15 ` Alexander Duyck [this message]
2016-11-02 11:16 ` [mm PATCH v2 23/26] dma: Add calls for dma_map_page_attrs and dma_unmap_page_attrs Alexander Duyck
2016-11-02 11:16 ` [mm PATCH v2 24/26] mm: Add support for releasing multiple instances of a page Alexander Duyck
2016-11-02 11:16 ` [mm PATCH v2 25/26] igb: Update driver to make use of DMA_ATTR_SKIP_CPU_SYNC Alexander Duyck
2016-11-02 11:16 ` [mm PATCH v2 26/26] igb: Update code to better handle incrementing page count Alexander Duyck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161102111549.79519.59449.stgit@ahduyck-blue-test.jf.intel.com \
--to=alexander.h.duyck@intel.com \
--cc=akpm@linux-foundation.org \
--cc=jcmvbkbc@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).