From: Christoph Hellwig <hch@lst•de>
To: iommu@lists•linux-foundation.org
Cc: Shawn Anastasio <shawn@anastas•io>, Will Deacon <will@kernel•org>,
linux-m68k@lists•linux-m68k.org, Guan Xuetao <gxt@pku•edu.cn>,
linuxppc-dev@lists•ozlabs.org, linux-kernel@vger•kernel.org,
Russell King <linux@armlinux•org.uk>,
linux-mips@vger•kernel.org, Paul Burton <paul.burton@mips•com>,
Geert Uytterhoeven <geert@linux-m68k•org>,
Catalin Marinas <catalin.marinas@arm•com>,
James Hogan <jhogan@kernel•org>,
Robin Murphy <robin.murphy@arm•com>,
linux-arm-kernel@lists•infradead.org
Subject: [PATCH 1/6] MIPS: remove support for DMA_ATTR_WRITE_COMBINE
Date: Fri, 16 Aug 2019 09:07:49 +0200 [thread overview]
Message-ID: <20190816070754.15653-2-hch@lst.de> (raw)
In-Reply-To: <20190816070754.15653-1-hch@lst.de>
Mips uses the KSEG1 kernel memory segment do map dma coherent
allocations for non-coherent devices as uncachable, and does not have
any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation
path. Thus supporting DMA_ATTR_WRITE_COMBINE in dma_mmap_attrs will
lead to multiple mappings with different caching attributes.
Fixes: 8c172467be36 ("MIPS: Add implementation of dma_map_ops.mmap()")
Signed-off-by: Christoph Hellwig <hch@lst•de>
---
arch/mips/Kconfig | 1 -
arch/mips/mm/dma-noncoherent.c | 8 --------
2 files changed, 9 deletions(-)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index d50fafd7bf3a..86e6760ef0d0 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1119,7 +1119,6 @@ config DMA_PERDEV_COHERENT
config DMA_NONCOHERENT
bool
- select ARCH_HAS_DMA_MMAP_PGPROT
select ARCH_HAS_SYNC_DMA_FOR_DEVICE
select ARCH_HAS_UNCACHED_SEGMENT
select NEED_DMA_MAP_STATE
diff --git a/arch/mips/mm/dma-noncoherent.c b/arch/mips/mm/dma-noncoherent.c
index ed56c6fa7be2..1d4d57dd9acf 100644
--- a/arch/mips/mm/dma-noncoherent.c
+++ b/arch/mips/mm/dma-noncoherent.c
@@ -65,14 +65,6 @@ long arch_dma_coherent_to_pfn(struct device *dev, void *cpu_addr,
return page_to_pfn(virt_to_page(cached_kernel_address(cpu_addr)));
}
-pgprot_t arch_dma_mmap_pgprot(struct device *dev, pgprot_t prot,
- unsigned long attrs)
-{
- if (attrs & DMA_ATTR_WRITE_COMBINE)
- return pgprot_writecombine(prot);
- return pgprot_noncached(prot);
-}
-
static inline void dma_sync_virt(void *addr, size_t size,
enum dma_data_direction dir)
{
--
2.20.1
next prev parent reply other threads:[~2019-08-16 7:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-16 7:07 cleanup the dma_pgprot handling Christoph Hellwig
2019-08-16 7:07 ` Christoph Hellwig [this message]
2019-08-16 7:07 ` [PATCH 2/6] unicore32: remove the unused pgprot_dmacoherent define Christoph Hellwig
2019-08-16 7:07 ` [PATCH 3/6] arm-nommu: " Christoph Hellwig
2019-08-16 7:07 ` [PATCH 4/6] dma-mapping: remove arch_dma_mmap_pgprot Christoph Hellwig
2019-08-16 7:43 ` Geert Uytterhoeven
2019-08-16 7:07 ` [PATCH 5/6] dma-mapping: make dma_atomic_pool_init self-contained Christoph Hellwig
2019-08-16 7:07 ` [PATCH 6/6] arm64: document the choice of page attributes for pgprot_dmacoherent Christoph Hellwig
2019-08-16 17:31 ` Will Deacon
2019-08-16 17:36 ` Mark Rutland
2019-08-16 17:59 ` Christoph Hellwig
2019-08-16 18:05 ` Will Deacon
2019-08-23 21:58 ` cleanup the dma_pgprot handling Paul Burton
2019-08-24 22:34 ` 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=20190816070754.15653-2-hch@lst.de \
--to=hch@lst$(echo .)de \
--cc=catalin.marinas@arm$(echo .)com \
--cc=geert@linux-m68k$(echo .)org \
--cc=gxt@pku$(echo .)edu.cn \
--cc=iommu@lists$(echo .)linux-foundation.org \
--cc=jhogan@kernel$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-m68k@lists$(echo .)linux-m68k.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=paul.burton@mips$(echo .)com \
--cc=robin.murphy@arm$(echo .)com \
--cc=shawn@anastas$(echo .)io \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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