Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] MIPS: ralink: reduce ARCH_DMA_MINALIGN
@ 2026-04-28  8:25 Qingfang Deng
  2026-05-26 14:42 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Qingfang Deng @ 2026-04-28  8:25 UTC (permalink / raw)
  To: Thomas Bogendoerfer, Qingfang Deng, linux-mips, linux-kernel
  Cc: Mieczyslaw Nalewaj, Felix Fietkau, Hauke Mehrtens,
	Aleksander Jan Bajkowski, Christian Marangi, Rosen Penev,
	Nick Hainke, openwrt-devel

Currently, Ralink 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 16 bytes for
RT288X and 32 bytes for other Ralink SoCs.

Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
---
 arch/mips/include/asm/mach-ralink/kmalloc.h | 9 +++++++++
 1 file changed, 9 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-ralink/kmalloc.h

diff --git a/arch/mips/include/asm/mach-ralink/kmalloc.h b/arch/mips/include/asm/mach-ralink/kmalloc.h
new file mode 100644
index 000000000000..1693209d3f37
--- /dev/null
+++ b/arch/mips/include/asm/mach-ralink/kmalloc.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __ASM_MACH_RALINK_KMALLOC_H
+#define __ASM_MACH_RALINK_KMALLOC_H
+
+#ifdef CONFIG_DMA_NONCOHERENT
+#define ARCH_DMA_MINALIGN	L1_CACHE_BYTES
+#endif
+
+#endif /* __ASM_MACH_RALINK_KMALLOC_H */
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: ralink: reduce ARCH_DMA_MINALIGN
  2026-04-28  8:25 [PATCH] MIPS: ralink: reduce ARCH_DMA_MINALIGN Qingfang Deng
@ 2026-05-26 14:42 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2026-05-26 14:42 UTC (permalink / raw)
  To: Qingfang Deng
  Cc: linux-mips, linux-kernel, Mieczyslaw Nalewaj, Felix Fietkau,
	Hauke Mehrtens, Aleksander Jan Bajkowski, Christian Marangi,
	Rosen Penev, Nick Hainke, openwrt-devel

On Tue, Apr 28, 2026 at 04:25:40PM +0800, Qingfang Deng wrote:
> Currently, Ralink 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 16 bytes for
> RT288X and 32 bytes for other Ralink SoCs.
> 
> Signed-off-by: Qingfang Deng <qingfang.deng@linux.dev>
> ---
>  arch/mips/include/asm/mach-ralink/kmalloc.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
>  create mode 100644 arch/mips/include/asm/mach-ralink/kmalloc.h

applied to mips-next

Thomas.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-26 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-28  8:25 [PATCH] MIPS: ralink: reduce ARCH_DMA_MINALIGN Qingfang Deng
2026-05-26 14:42 ` Thomas Bogendoerfer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox