[PATCH] asm/io: Change the memory type description of ioremap_wc/wt()

JianChunfu jansef.jian at hj-micro.com
Thu Aug 22 03:34:09 PDT 2024


I had tested ioremap_wc() in my machine and the mapping result is:
---ioremap_wc(Sysetem RAM reserved) is NULL;
---ioremap_wc(some PCI Device addr) is okay.

As far as I know, the memory type of WriteCombine can be used in
I/O memory, this is the same as Normal_NC in arm. so the function
ioremap_wc/wt() is aimed at device momory while not normal memory
such as sram or dram, and the test result proves it too.

The notes are a little vague and misleading, so change it. Or am I
getting it wrong? The information on my machine is kernel-5.10 with
aarch64.

Signed-off-by: JianChunfu <jansef.jian at hj-micro.com>
---
 arch/arm/include/asm/io.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h
index 1815748f5..91a90e869 100644
--- a/arch/arm/include/asm/io.h
+++ b/arch/arm/include/asm/io.h
@@ -340,8 +340,8 @@ static inline void memcpy_toio(volatile void __iomem *to, const void *from,
  * Function		Memory type	Cacheability	Cache hint
  * ioremap()		Device		n/a		n/a
  * ioremap_cache()	Normal		Writeback	Read allocate
- * ioremap_wc()		Normal		Non-cacheable	n/a
- * ioremap_wt()		Normal		Non-cacheable	n/a
+ * ioremap_wc()		Normal(Dev mem)	Non-cacheable	n/a
+ * ioremap_wt()		Normal(Dev mem)	Non-cacheable	n/a
  *
  * All device mappings have the following properties:
  * - no access speculation
-- 
2.31.1




More information about the linux-arm-kernel mailing list