Skip to contentSkip to conversation

MIPS: ath79: reduce ARCH_DMA_MINALIGN

PATCH Applied Rosen Penev 2 participants 2 messages May 27 – Jun 15 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: ath79: reduce ARCH_DMA_MINALIGN

Currently, ath79 SoCs use the default ARCH_DMA_MINALIGN value of 128 bytes defined in mach-generic. This is excessive for these platforms and leads to significant memory waste in kmalloc.

Override ARCH_DMA_MINALIGN to use L1_CACHE_BYTES, which is 32 bytes for ath79 SoCs.

---
 arch/mips/include/asm/mach-ath79/kmalloc.h | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-ath79/kmalloc.h
arch/mips/include/asm/mach-ath79/kmalloc.h new file +7 -0
new file mode 100644
index 000000000000..954f5d6e0dd0
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_MACH_ATH79_KMALLOC_H
+#define __ASM_MACH_ATH79_KMALLOC_H
+
+#define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
+
+#endif /* __ASM_MACH_ATH79_KMALLOC_H */
Signature · 1 line
2.54.0
maintainer Applied
#1 lore raw
Quoted 28 lines · Rosen Penev

Currently, ath79 SoCs use the default ARCH_DMA_MINALIGN value of 128 bytes defined in mach-generic. This is excessive for these platforms and leads to significant memory waste in kmalloc.

Override ARCH_DMA_MINALIGN to use L1_CACHE_BYTES, which is 32 bytes for ath79 SoCs.

---
 arch/mips/include/asm/mach-ath79/kmalloc.h | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-ath79/kmalloc.h
arch/mips/include/asm/mach-ath79/kmalloc.h new file +7 -0
new file mode 100644
index 000000000000..954f5d6e0dd0
@@ -0,0 +1,7 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_MACH_ATH79_KMALLOC_H
+#define __ASM_MACH_ATH79_KMALLOC_H
+
+#define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
+
+#endif /* __ASM_MACH_ATH79_KMALLOC_H */
Signature · 1 line
2.54.0

applied to mips-next

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]