From: Christoph Hellwig <hch@lst.de>
To: iommu@lists.linux-foundation.org
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
Michal Simek <monstr@monstr.eu>,
David Howells <dhowells@redhat.com>,
Guan Xuetao <gxt@mprc.pku.edu.cn>,
Chris Zankel <chris@zankel.net>,
Max Filippov <jcmvbkbc@gmail.com>,
x86@kernel.org, linux-mips@linux-mips.org,
linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-xtensa@linux-xtensa.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 09/11] xtensa: make dma_cache_sync a no-op
Date: Tue, 3 Oct 2017 12:43:09 +0200 [thread overview]
Message-ID: <20171003104311.10058-10-hch@lst.de> (raw)
In-Reply-To: <20171003104311.10058-1-hch@lst.de>
xtensa does not implement DMA_ATTR_NON_CONSISTENT allocations, so it
doesn't make any sense to do any work in dma_cache_sync given that it
must be a no-op when dma_alloc_attrs returns coherent memory.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
arch/xtensa/include/asm/dma-mapping.h | 6 ++++--
arch/xtensa/kernel/pci-dma.c | 23 -----------------------
2 files changed, 4 insertions(+), 25 deletions(-)
diff --git a/arch/xtensa/include/asm/dma-mapping.h b/arch/xtensa/include/asm/dma-mapping.h
index 269738dc9d1d..353e0314d6ba 100644
--- a/arch/xtensa/include/asm/dma-mapping.h
+++ b/arch/xtensa/include/asm/dma-mapping.h
@@ -23,8 +23,10 @@ static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus)
return &xtensa_dma_map_ops;
}
-void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
- enum dma_data_direction direction);
+static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
+ enum dma_data_direction direction)
+{
+}
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
{
diff --git a/arch/xtensa/kernel/pci-dma.c b/arch/xtensa/kernel/pci-dma.c
index cec86a1c2acc..623720a11143 100644
--- a/arch/xtensa/kernel/pci-dma.c
+++ b/arch/xtensa/kernel/pci-dma.c
@@ -26,29 +26,6 @@
#include <asm/cacheflush.h>
#include <asm/io.h>
-void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
- enum dma_data_direction dir)
-{
- switch (dir) {
- case DMA_BIDIRECTIONAL:
- __flush_invalidate_dcache_range((unsigned long)vaddr, size);
- break;
-
- case DMA_FROM_DEVICE:
- __invalidate_dcache_range((unsigned long)vaddr, size);
- break;
-
- case DMA_TO_DEVICE:
- __flush_dcache_range((unsigned long)vaddr, size);
- break;
-
- case DMA_NONE:
- BUG();
- break;
- }
-}
-EXPORT_SYMBOL(dma_cache_sync);
-
static void do_cache_op(dma_addr_t dma_handle, size_t size,
void (*fn)(unsigned long, unsigned long))
{
--
2.14.1
next prev parent reply other threads:[~2017-10-03 10:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 10:43 refactor dma_cache_sync V2 Christoph Hellwig
2017-10-03 10:43 ` [PATCH 01/11] floppy: consolidate the dummy fd_cacheflush definition Christoph Hellwig
2017-10-03 10:43 ` [PATCH 02/11] x86: make dma_cache_sync a no-op Christoph Hellwig
2017-10-03 16:02 ` David Laight
2017-10-03 20:27 ` Thomas Gleixner
2017-10-03 10:43 ` [PATCH 03/11] frv: " Christoph Hellwig
2017-10-03 10:43 ` [PATCH 04/11] ia64: " Christoph Hellwig
2017-10-04 8:59 ` David Laight
2017-10-04 9:06 ` 'Christoph Hellwig'
2017-10-03 10:43 ` [PATCH 05/11] microblaze: " Christoph Hellwig
2017-10-03 10:43 ` [PATCH 06/11] mn10300: " Christoph Hellwig
2017-10-03 10:43 ` [PATCH 07/11] powerpc: " Christoph Hellwig
2017-10-03 11:24 ` Christophe LEROY
2017-10-03 11:43 ` Robin Murphy
2017-10-03 11:43 ` Christoph Hellwig
2017-10-04 8:29 ` Christophe LEROY
2017-10-03 10:43 ` [PATCH 08/11] unicore32: " Christoph Hellwig
2017-10-03 10:43 ` Christoph Hellwig [this message]
2017-10-03 10:43 ` [PATCH 10/11] sh: " Christoph Hellwig
2017-10-03 10:43 ` [PATCH 11/11] dma-mapping: turn dma_cache_sync into a dma_map_ops method Christoph Hellwig
2017-10-03 11:49 ` refactor dma_cache_sync V2 Robin Murphy
2017-10-16 12:44 ` Christoph Hellwig
2017-10-19 15:02 ` Christoph Hellwig
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=20171003104311.10058-10-hch@lst.de \
--to=hch@lst.de \
--cc=chris@zankel.net \
--cc=dhowells@redhat.com \
--cc=gxt@mprc.pku.edu.cn \
--cc=iommu@lists.linux-foundation.org \
--cc=jcmvbkbc@gmail.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux-sh@vger.kernel.org \
--cc=linux-xtensa@linux-xtensa.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=m.szyprowski@samsung.com \
--cc=monstr@monstr.eu \
--cc=robin.murphy@arm.com \
--cc=x86@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).