]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: Increase ARCH_DMA_MINALIGN up to 16
authorHuacai Chen <chenhuacai@loongson.cn>
Sun, 30 Mar 2025 08:31:09 +0000 (16:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:37:41 +0000 (14:37 +0200)
commit279ec25c2df49fba1cd9488f2ddd045d9cb2112e
tree2f3af83ab6a8e8504f3e6b2f2c7e2df6ec0c571e
parentacacd48a37b52fc95f621765762c04152b58d642
LoongArch: Increase ARCH_DMA_MINALIGN up to 16

commit 4103cfe9dcb88010ae4911d3ff417457d1b6a720 upstream.

ARCH_DMA_MINALIGN is 1 by default, but some LoongArch-specific devices
(such as APBDMA) require 16 bytes alignment. When the data buffer length
is too small, the hardware may make an error writing cacheline. Thus, it
is dangerous to allocate a small memory buffer for DMA. It's always safe
to define ARCH_DMA_MINALIGN as L1_CACHE_BYTES but unnecessary (kmalloc()
need small memory objects). Therefore, just increase it to 16.

Cc: stable@vger.kernel.org
Tested-by: Binbin Zhou <zhoubinbin@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/include/asm/cache.h