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=1796221363; b=YMjjcrurincfs/MPT4WphdPpkZZ+p5PxhIO+PQVwYe2We9Vwn21Xt9SCPSPuGaPcf5XN 0fPyjXuQqml6kwpJzCd15KpxNxdD8N7Q1Q0zRp3Wd6bvQCHfqW8NbNwl4abLicFH1k9TF 55AkBPxJ5ZfKc89VpP13KjAH9/8NUN1cErQ74iebDQpwtaLI9qjKvLNHS2HtPKgwDoU+a aSAiodQn08tUM4j14TlfGgbq5EJ57DRyBXkBNo/y14S0NemsgyOKbXhfTGswVeQrFDxy9 AUCHRYXqfTh+rsxFpVGNKhugalFVmsoHYxyc7cVEj4sIxGGNHA7mf1N8+WZ9bYW4Mxw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221363; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=3s8jtk/1GV4zg+I8FPp+SACn0LubRNxoHJXLi3gJdIM=; b=y9WQA/7x8FB1SdKx4JniioeP4PT+4KNXhRMJx5s7reSA8F1d/+dONZjeZ8ke9cFOSGYF JZciahHh0my46dlSSb/e7ONDqCIkBhwD9tJjaoVnApq7XikuLcfEgTz/1xkXG4Aep0/oz t+hoDtZ6dvXU6I6I8L+pu1kGwiQEJhQeyUKu277sorlLkX265A1URgdIFF0mV//LLc3c2 Panr4I2rSm70ztNPD36wZQFzaqwgXlV3hIwHVsit7n+ZhrA+4+A+CtkOZ7L0qc0DK9cTT 2+GFoRl/3vNHj/6mdlmDPMBrntnwZVM+xmEZQYEcydurK+gRHqcuZ45WIH0F8TnQ1zA== 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=gsMrcJjg; 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 AF62B606A32A for ; Wed, 2 Dec 2026 14:22:43 +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=gsMrcJjg Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03F771F000C1; Wed, 2 Dec 2026 14:22:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221363; bh=3s8jtk/1GV4zg+I8FPp+SACn0LubRNxoHJXLi3gJdIM=; h=Subject:To:Cc:From:Date; b=gsMrcJjgAsOv4Bb2XuyiSvf0CxPJYN0+Fwxm9IX7ts+uhnxM+8qyN5k52l/giaHQF ASlqJNhBQeA+ZxuAt3/MhxIs4Fdth6rCw77R76vfHrBVbhw4ihaHEfe3QVoD3i2lLy gjZBjKgFGB2Wu5uS5KloXUOXw+DdEZetQwnDykdw= Subject: FAILED: patch "[PATCH] riscv: mm: reserve the DTB before scanning reserved memory" failed to apply to 6.6-stable tree To: m.szyprowski@samsung.com,pjw@kernel.org Cc: From: Date: Wed, 02 Dec 2026 14:41:31 +0100 Message-ID: <2026120231-unchain-virus-1036@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.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 . 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.6.y git checkout FETCH_HEAD git cherry-pick -x fc91dacd0c2b4f9ca7e0ce30016f5aee6256cba5 # git commit -s git send-email --to '' --in-reply-to '2026120231-unchain-virus-1036@gregkh' --subject-prefix 'PATCH 6.6.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