From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796221355; b=jBLSQD+K6SMYoroQKrV+6GaAnsAKcnp3am2E2XF2qfV4NsxMcEwsGbNDBZyugwFE1Y5V 2U/CXqiQocdyK9sfCdZ5lQ7yS04JJmdmNnOyzbQpoA+WLyygq/sJ+qhf4ve/pvU6TYxze 5FsDE2ztwud1/F3I4iRLBXcF4a2RlNw4CxCilGxYUFOAdpOjLWRjSS7RTH+9p9YSNBB5W Qc6WeBGqBPkTQeoH1JEdPyzzIf/eecSrCZ75kvFfMl87KUgYkn6jHUB/bxiToeVgglfed te3ee2uRGm1TAdP5p9gpqDqs+k0gL+Efl1022B0FtBfmnH3Fw4W1ZhBeHfBhm9bN/IQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221355; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=SFtkpKkc7bxrmbQk7s6ApGeJmRq7YYd18yngcN5OpwQ=; b=vkC3Jd9U2v4rlBoAuGXSCglriSLXyhjYcnKBtPhXXkuHwTLEs9P/oqczcXoOSdu9VYcF VSWXhGeKnp+FcPSK/MpiYL+V2MEz6v4UQPz1YxyBvDtKhBsx2rMt4SZ5eWo9urzE5jYf4 jALeOCBuoJWdO4bifrC60b56YRtPzFFXojjLcQYeyIzXQOBUvukPZ2YMesiB6pvCQfYkR JY0eA6dx7CUp5UuUr7LrB1TnR0a8u0/N6mvrRP9kLJpk9OzrnUOS7TlkC85uYXwq/1rNk gPMhtWnnXKxHZ361o6JAZPJsUDxE1sQCgv/LF3B4oHDahbYx88kCNLRM9mLVl4hDPaQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pp+nVnEZ; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C1AC606A31A for ; Wed, 2 Dec 2026 14:22:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=pp+nVnEZ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47A0E1F00897; Wed, 2 Dec 2026 14:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221354; bh=SFtkpKkc7bxrmbQk7s6ApGeJmRq7YYd18yngcN5OpwQ=; h=Subject:To:Cc:From:Date; b=pp+nVnEZRGbAzagjN+UJzyTpquL2Zj5LmS2MPsAbl+sk5kRjVfxAnzFq2vae/cOk+ lG81SdSv6v35cgO0Wtkap1f28bgla89tgA/mLrvKUxLL4lZHm2/714s8xyybAEgvP7 9FsUt0y1rVQFjW/T4FMf8dGbhawLY7hbqUCp/5Dk= Subject: FAILED: patch "[PATCH] riscv: mm: reserve the DTB before scanning reserved memory" failed to apply to 6.12-stable tree To: m.szyprowski@samsung.com,pjw@kernel.org Cc: From: Date: Wed, 02 Dec 2026 14:41:30 +0100 Message-ID: <2026120230-stroller-atypical-3eb0@gregkh> X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.12-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 . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y git checkout FETCH_HEAD git cherry-pick -x fc91dacd0c2b4f9ca7e0ce30016f5aee6256cba5 # git commit -s git send-email --to '' --in-reply-to '2026120230-stroller-atypical-3eb0@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..' Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From fc91dacd0c2b4f9ca7e0ce30016f5aee6256cba5 Mon Sep 17 00:00:00 2001 From: Marek Szyprowski Date: Wed, 4 Nov 2026 11:46:03 +0100 Subject: [PATCH] riscv: mm: reserve the DTB before scanning reserved memory early_init_fdt_scan_reserved_mem() allocates memory from memblock while it scans /reserved-memory: the reserved_mem array, and the regions that are placed dynamically by size. On RISC-V the DTB was only reserved after that scan, so memblock could hand out the memory the DTB occupies while the DTB was still being parsed. Reserve the DTB before the scan, so that memblock never allocates from it. Fixes: ef69d2559fe9 ("riscv: Move early dtb mapping into the fixmap region") Closes: https://lore.kernel.org/all/b71ac175-fba5-4f61-bbdb-0b98dec9ccee@samsung.com/ Signed-off-by: Marek Szyprowski Link: https://patch.msgid.link/20261104104604.3370384-1-m.szyprowski@samsung.com Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c index 070ee69eabb3..d73688402b50 100644 --- a/arch/riscv/mm/init.c +++ b/arch/riscv/mm/init.c @@ -294,13 +294,6 @@ static void __init setup_bootmem(void) reserve_initrd_mem(); - /* - * No allocation should be done before reserving the memory as defined - * in the device tree, otherwise the allocation could end up in a - * reserved region. - */ - early_init_fdt_scan_reserved_mem(); - /* * If DTB is built in, no need to reserve its memblock. * Otherwise, do reserve it but avoid using @@ -309,6 +302,13 @@ static void __init setup_bootmem(void) */ if (!IS_ENABLED(CONFIG_BUILTIN_DTB)) memblock_reserve(dtb_early_pa, fdt_totalsize(dtb_early_va)); + + /* + * No allocation should be done before reserving the memory as defined + * in the device tree, otherwise the allocation could end up in a + * reserved region. + */ + early_init_fdt_scan_reserved_mem(); } #ifdef CONFIG_RELOCATABLE