From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8074482899; Sun, 1 Mar 2026 01:37:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329072; cv=none; b=S+J03L8lZZ4tOpz9XEGJOi+Dpfme9pdO1rrwsTlaudYl99pp/5eC6V7lehWfMtgLej0nzwKto5JFM8e0to/jwCwwlwg964182RrHyJgiOvFcLOWdxpsEP6hdlKsqZgZnn0nNqRYMXM1RhRRGCq0TyTA2zNQcQzmVXXXQSFB53Lw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329072; c=relaxed/simple; bh=mjUcYPePh3DsTnivUBVNFIQU4C3qm8TF/8qlGoDr5Go=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=CdYMykrwuBpdHTT8PcY5BG2fpcqjHSdv+zp9OCr+CUfLPRcD3/N+DaW2YiHyFxnT74u//zVeXt4lXDdW/VIXJdkRfkUiob1i1oGRDpkSuJBUqISFr2rPL5qs6rEWMM2y5QZOqeGEEEwEX6EfHIFxB42lj/S/SA6IkVO/qUmGBWE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HPOHqrOc; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HPOHqrOc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B7CAC19421; Sun, 1 Mar 2026 01:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329072; bh=mjUcYPePh3DsTnivUBVNFIQU4C3qm8TF/8qlGoDr5Go=; h=From:To:Cc:Subject:Date:From; b=HPOHqrOcyFETkS8yc6WZgX2rPd1ywx3h5t8fRHmDqvAYkNVwpTrhMiGeVygATZY/0 X9ahudHPyGH+8GHMkqYMyB6mVZmQ9m97pSCKeDmKPIDUKCdFSSxZ6+ANbx1Fqh5WXB 2SETumevPbuFsYv/j9oQoLcEct6nDeq2mQPxqNqhLWolnKlA6OsVmcDhGPk84kCzTX wpkM+BV7W277Po9RHSNJs9ZMuGUm99Q8iRRXzBa4nxafTGos6Sq+CD0jHIsQkIOe76 NNCKZBuAvbxF5j8MdK4E+b7FCbCjb17+Ne44dAQ6Z2qyHzex4EoECJTjnuAhjtVkbt 22C8wQelZ/E4Q== From: Sasha Levin To: stable@vger.kernel.org, chenhuacai@kernel.org Cc: Huacai Chen , loongarch@lists.linux.dev Subject: FAILED: Patch "LoongArch: Prefer top-down allocation after arch_mem_init()" failed to apply to 6.6-stable tree Date: Sat, 28 Feb 2026 20:37:50 -0500 Message-ID: <20260301013750.1698102-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.6-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 2172d6ebac9372eb01fe4505a53e18cb061e103b Mon Sep 17 00:00:00 2001 From: Huacai Chen Date: Tue, 10 Feb 2026 19:31:13 +0800 Subject: [PATCH] LoongArch: Prefer top-down allocation after arch_mem_init() Currently we use bottom-up allocation after sparse_init(), the reason is sparse_init() need a lot of memory, and bottom-up allocation may exhaust precious low memory (below 4GB). On the other hand, SWIOTLB and CMA need low memories for DMA32, so swiotlb_init() and dma_contiguous_reserve() need bottom-up allocation. Since swiotlb_init() and dma_contiguous_reserve() are both called in arch_mem_init(), we no longer need bottom-up allocation after that. So we set the allocation policy to top-down at the end of arch_mem_init(), in order to avoid later memory allocations (such as KASAN) exhaust low memory. This solve at least two problems: 1. Some buggy BIOSes use 0xfd000000~0xfe000000 for secondary CPUs, but didn't reserve this range, which causes smpboot failures. 2. Some DMA32 devices, such as Loongson-DRM and OHCI, cannot work with KASAN enabled. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen --- arch/loongarch/kernel/setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c index 20cb6f3064568..2b260d15b2e25 100644 --- a/arch/loongarch/kernel/setup.c +++ b/arch/loongarch/kernel/setup.c @@ -421,6 +421,7 @@ static void __init arch_mem_init(char **cmdline_p) PFN_UP(__pa_symbol(&__nosave_end))); memblock_dump_all(); + memblock_set_bottom_up(false); early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn)); } -- 2.51.0