From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CE2F29B79B for ; Tue, 28 Apr 2026 08:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777364770; cv=none; b=GxtFzcqFFv1FHIMLAEP5QbBCqqqCht8Nc4roN22hAHJE3NBOkerQC9NQuaF7IFB26DcqUWjBjeN7FotwXX2p9LM0I/XCHrng38I65oKPDZ0SbL4QLWINXUX49QCyr6Qhs+zqRYSwB2NDRlGlB5lEqjPy5XmsAH2hBxLt2iom66w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777364770; c=relaxed/simple; bh=N5pnnNDxjYCpffJbmExg20y+5MX7MDoO5hWlmA/m6zw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jcBk2RddzhgPJkrRPRXPDzFzWQDPWX3N4GEEO5h3HCZvViNndkmU5EplMAzD0zyfVZ7oQLsGXyS3j8aQPBatTFr0MdcDfKKwfw2clQvcekywMyDqxw7wi+5thr5cxeQNyQQo/xEwLVlfYUDXpy2TYtcEtoW2Ebx5sFCzNQySUec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=Ss5KZ1zG; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="Ss5KZ1zG" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1777364765; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=11q5oz16touL9vV9JV8N3vUJRYbj1YLjofdcEYdHyuE=; b=Ss5KZ1zGcXPnv6r5b4U7i7xPwWm6c53xFGyh/whfz/b34aXCJ62Fwb2AI3r7am8pGbI/k6 7FBgGNpmOfyDePqtbAnsgm+YW50mQfSnaKTrELinrFa7UvBhvlwHYzdFPOolX7GBI9P5jc gjejC1f+yCHR4qwBC/rRl4Jpe+ZdD/g= From: Qingfang Deng To: Thomas Bogendoerfer , Qingfang Deng , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mieczyslaw Nalewaj , Felix Fietkau , Hauke Mehrtens , Aleksander Jan Bajkowski , Christian Marangi , Rosen Penev , Nick Hainke , openwrt-devel@lists.openwrt.org Subject: [PATCH] MIPS: ralink: reduce ARCH_DMA_MINALIGN Date: Tue, 28 Apr 2026 16:25:40 +0800 Message-ID: <20260428082543.95896-1-qingfang.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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 --- 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