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=1796221360; b=Qkmqe1euN2aesPveKhJZsbCxgAcijcVL9Go5zn8ksVBenLvQTiazdsJX1udHILc3w9XO q0BONQ/hInp7njSZnrVTUmsn1YCgjKWHqxJSAtGgiYZN6hW1HXxft3id7VPoFgESVotkD kEkAChDuj+hP+fbUZffolsylZlYRmlGxdQzaWzuhYJ6Dpf/ad91QlcJlYr7fHFkKf59Nm 9XbZ8dbJ+3INFCCKnhl83JLbXbwNfLNue5F9FEUMVj1AL1F5xp9TIV5zC5pgVVS3uirnv oZ9fIOSgNwi6bq9nq6KJa9OTl19MdUTDr6kDQIUjAY/aT96tlFG4Xc6OivDcQjO9Ang== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796221360; h=Received:DKIM-Signature:Subject:To:Cc:From:Date:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=+2i3vCMHTFHmKACsDQ6DPYdfeRZvHGCFej+zFdS3WRc=; b=E0cU1bXIDXpeWi7DR+jzv4+8p08kc7bMCPyr2Bq5ykKYuAh5gkHeoUs9uc8WrOcPm1bz Wnpr53P+majupwvHXDcjA/C2BKc7pgFIonwBUVAJo0mS3fCNhNPD2pSXxtoHfz8Uk9eSe Dj3dr/bCy9unRHB5Ur0GvJOIiU94a1yovk6gjlDl/nKJK2qcN3x/a5G4IwjQmvFWswHre mqZ/VvYGil2nvrOCgkvo2BAbC2LWlafLi5dc/fcwk9ylxrqTh97Y0IJDScPWbxP04uaaX 3CcipfZU1udreaFcMBXIhGYnAyYOflloM7kaTbPf8T8HiAa14dnPXh60CK+sAvu7J3g== 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=wzAd2k9I; 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 D7CF2606A31A for ; Wed, 2 Dec 2026 14:22:40 +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=wzAd2k9I Received: by smtp.kernel.org (Postfix) with ESMTPSA id 352141F00896; Wed, 2 Dec 2026 14:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796221360; bh=+2i3vCMHTFHmKACsDQ6DPYdfeRZvHGCFej+zFdS3WRc=; h=Subject:To:Cc:From:Date; b=wzAd2k9IyEKBpoBTN6O2PdLCk7RNijnxn7VJ3HL8mMW0kqs9PeLPD3JLwFicer8uA HC+2TrjQ9XPBEK3rNiSSuPk68+xuc87wf5BYaocgYYSDAc4YK8TfwNnCGvo0LGGZPz 2qNE2lcvUypzTocDcMUNTbvwexY0j7YgZGcSSW3s= Subject: FAILED: patch "[PATCH] riscv: mm: reserve the DTB before scanning reserved memory" failed to apply to 6.1-stable tree To: m.szyprowski@samsung.com,pjw@kernel.org Cc: From: Date: Wed, 02 Dec 2026 14:41:31 +0100 Message-ID: <2026120231-unelected-earache-f97e@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.1-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.1.y git checkout FETCH_HEAD git cherry-pick -x fc91dacd0c2b4f9ca7e0ce30016f5aee6256cba5 # git commit -s git send-email --to '' --in-reply-to '2026120231-unelected-earache-f97e@gregkh' --subject-prefix 'PATCH 6.1.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