summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorXiongfeng Wang <wangxiongfeng2@huawei.com>2021-12-21 11:55:56 +0800
committerCatalin Marinas <catalin.marinas@arm.com>2021-12-22 10:44:53 +0000
commitd5624bb29f49b849ac8d1e9783dbf9c65cf33457 (patch)
tree15c4737e7664df0afd23cbca92a32e7ed7c47a0d /include
parentc2c529b27ceb394ff4d3273ed1f552195fc4d555 (diff)
downloadlinux-stable-d5624bb29f49b849ac8d1e9783dbf9c65cf33457.tar.gz
linux-stable-d5624bb29f49b849ac8d1e9783dbf9c65cf33457.tar.bz2
linux-stable-d5624bb29f49b849ac8d1e9783dbf9c65cf33457.zip
asm-generic: introduce io_stop_wc() and add implementation for ARM64
For memory accesses with write-combining attributes (e.g. those returned by ioremap_wc()), the CPU may wait for prior accesses to be merged with subsequent ones. But in some situation, such wait is bad for the performance. We introduce io_stop_wc() to prevent the merging of write-combining memory accesses before this macro with those after it. We add implementation for ARM64 using DGH instruction and provide NOP implementation for other architectures. Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Suggested-by: Will Deacon <will@kernel.org> Suggested-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20211221035556.60346-1-wangxiongfeng2@huawei.com Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/barrier.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/asm-generic/barrier.h b/include/asm-generic/barrier.h
index 640f09479bdf..4c2c1b830344 100644
--- a/include/asm-generic/barrier.h
+++ b/include/asm-generic/barrier.h
@@ -251,5 +251,16 @@ do { \
#define pmem_wmb() wmb()
#endif
+/*
+ * ioremap_wc() maps I/O memory as memory with write-combining attributes. For
+ * this kind of memory accesses, the CPU may wait for prior accesses to be
+ * merged with subsequent ones. In some situation, such wait is bad for the
+ * performance. io_stop_wc() can be used to prevent the merging of
+ * write-combining memory accesses before this macro with those after it.
+ */
+#ifndef io_stop_wc
+#define io_stop_wc do { } while (0)
+#endif
+
#endif /* !__ASSEMBLY__ */
#endif /* __ASM_GENERIC_BARRIER_H */