OpenCloudOS-Kernel/arch
Shawn Anastasio b4fc36e60f powerpc/dma: Fix invalid DMA mmap behavior
The refactor of powerpc DMA functions in commit 6666cc17d7
("powerpc/dma: remove dma_nommu_mmap_coherent") incorrectly
changes the way DMA mappings are handled on powerpc.
Since this change, all mapped pages are marked as cache-inhibited
through the default implementation of arch_dma_mmap_pgprot.
This differs from the previous behavior of only marking pages
in noncoherent mappings as cache-inhibited and has resulted in
sporadic system crashes in certain hardware configurations and
workloads (see Bugzilla).

This commit restores the previous correct behavior by providing
an implementation of arch_dma_mmap_pgprot that only marks
pages in noncoherent mappings as cache-inhibited. As this behavior
should be universal for all powerpc platforms a new file,
dma-generic.c, was created to store it.

Fixes: 6666cc17d7 ("powerpc/dma: remove dma_nommu_mmap_coherent")
# NOTE: fixes commit 6666cc17d7 released in v5.1.
# Consider a stable tag:
# Cc: stable@vger.kernel.org # v5.1+
# NOTE: fixes commit 6666cc17d7 released in v5.1.
# Consider a stable tag:
# Cc: stable@vger.kernel.org # v5.1+
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: Shawn Anastasio <shawn@anastas.io>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190717235437.12908-1-shawn@anastas.io
2019-07-19 21:29:49 +10:00
..
alpha Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
arc Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
arm ARM: 2019-07-12 15:35:14 -07:00
arm64 This is the bulk of pin control changes for the v5.3 kernel 2019-07-13 15:02:27 -07:00
c6x Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-07-10 21:42:03 -07:00
csky Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
h8300 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2019-07-10 21:42:03 -07:00
hexagon Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
ia64 TTY / Serial driver updates for 5.3-rc1 2019-07-11 15:38:21 -07:00
m68k Merge branch 'akpm' (patches from Andrew) 2019-07-12 11:40:28 -07:00
microblaze clone3-v5.3 2019-07-11 10:09:44 -07:00
mips asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
nds32 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
nios2 nios2 update for v5.3-rc1 2019-07-12 15:38:05 -07:00
openrisc dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
parisc Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
powerpc powerpc/dma: Fix invalid DMA mmap behavior 2019-07-19 21:29:49 +10:00
riscv Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
s390 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
sh asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc 2019-07-13 16:04:19 -07:00
um Kbuild updates for v5.3 2019-07-12 16:03:16 -07:00
unicore32 Kconfig updates for v5.3 2019-07-12 16:06:27 -07:00
x86 asm-generic: remove ptrace.h 2019-07-12 15:41:33 -07:00
xtensa dma-mapping updates for Linux 5.3 2019-07-12 15:13:55 -07:00
.gitignore
Kconfig dma-direct: provide generic support for uncached kernel segments 2019-06-03 16:00:08 +02:00