From nobody Fri Apr 3 22:33:34 2026 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) (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 6B19238AC95 for ; Mon, 23 Mar 2026 10:09:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.118.77.12 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774260557; cv=none; b=RIsScmy6VVhoJx8FWg1E98lfW8Y7qqSsISIdeNiZssMeUaUILGcIRFOzkfCmCXZ39n/BvK53AdPfw+IEOROH4ZKFKuVe7a2sFgL1S0ISe+K7BSqrd7qW0oNL/spiT+9ZyeBw/PC3JitqNuGnfmWdgsBNCky6/PfxsbFiFRy7Hyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774260557; c=relaxed/simple; bh=lIpGm9w9sQdb12Ur9F4Sb3EiTSGgkied7VvY4NFy6No=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=aEDpK2ewAuzGnSYfhNrg/rrOizyXePFKEL3EF6Y5KasSyVCLCyFSdAEKxLtpLnoVJtY+MhRffzScNh38cfkDYs3Pv6LNPjobsW12zfz5NOAjJspxjmKG1KoRjBrs4H6sICAAOqVcfkXk2wilX/lMsVzqbywLVqv93cIZcTjAPtA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=FUCRWglD; arc=none smtp.client-ip=210.118.77.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="FUCRWglD" Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20260323100914euoutp0222e4f383bc573a70a1036e357a74e4b4~fcJLM0_iO2329223292euoutp02e for ; Mon, 23 Mar 2026 10:09:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20260323100914euoutp0222e4f383bc573a70a1036e357a74e4b4~fcJLM0_iO2329223292euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1774260554; bh=XnpG/ghmAqbS6QKwZNF5IxO0PeBEQO07aIL3Tp2D5sY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FUCRWglDvcz6v+kCemIlvGSD7pNISs5yAxcT2r7ya/G7VI7UyRLCBkT9zC3UULCMV Eem7IL2mnlBxEZ1z7lF7vcs2tzmJS2nw5Xp9z3VjP2Dd6YVmFtQFTPo0NBiSqS5TpR zQbp6vhU7+W0tyRiJ6+JtoAl7UXpqOmsXNsxauzc= Received: from eusmtip2.samsung.com (unknown [203.254.199.222]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20260323100912eucas1p1f13cc5bfc49a119c7f1e0d6bd754d42c~fcJJeUWMb0541705417eucas1p1O; Mon, 23 Mar 2026 10:09:12 +0000 (GMT) Received: from AMDC4653.digital.local (unknown [106.120.51.32]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20260323100911eusmtip2884e9a5ebc23eed9d8cea4e2a5e97500~fcJI7eMUO0421504215eusmtip2T; Mon, 23 Mar 2026 10:09:11 +0000 (GMT) From: Marek Szyprowski To: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux.dev Cc: Marek Szyprowski , Rob Herring , Krzysztof Kozlowski , Oreoluwa Babatunde , Saravana Kannan , Andrew Morton , Robin Murphy Subject: [PATCH v2 6/7] of: reserved_mem: clarify fdt_scan_reserved_mem*() functions Date: Mon, 23 Mar 2026 11:09:00 +0100 Message-Id: <20260323100901.4079171-7-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260323100901.4079171-1-m.szyprowski@samsung.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CMS-MailID: 20260323100912eucas1p1f13cc5bfc49a119c7f1e0d6bd754d42c X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20260323100912eucas1p1f13cc5bfc49a119c7f1e0d6bd754d42c X-EPHeader: CA X-CMS-RootMailID: 20260323100912eucas1p1f13cc5bfc49a119c7f1e0d6bd754d42c References: <20260323100901.4079171-1-m.szyprowski@samsung.com> Rename fdt_scan_reserved_mem_reg_nodes() to fdt_scan_reserved_mem_late() to clearly show how it differs from fdt_scan_reserved_mem() and update description of both functions. Signed-off-by: Marek Szyprowski --- drivers/of/fdt.c | 2 +- drivers/of/of_private.h | 2 +- drivers/of/of_reserved_mem.c | 24 +++++++++++++++--------- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 331646d667b9..43a0944ca462 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -1274,7 +1274,7 @@ void __init unflatten_device_tree(void) void *fdt =3D initial_boot_params; =20 /* Save the statically-placed regions in the reserved_mem array */ - fdt_scan_reserved_mem_reg_nodes(); + fdt_scan_reserved_mem_late(); =20 /* Populate an empty root node when bootloader doesn't provide one */ if (!fdt) { diff --git a/drivers/of/of_private.h b/drivers/of/of_private.h index df0bb00349e0..0ae16da066e2 100644 --- a/drivers/of/of_private.h +++ b/drivers/of/of_private.h @@ -186,7 +186,7 @@ static inline struct device_node *__of_get_dma_parent(c= onst struct device_node * #endif =20 int fdt_scan_reserved_mem(void); -void __init fdt_scan_reserved_mem_reg_nodes(void); +void __init fdt_scan_reserved_mem_late(void); =20 bool of_fdt_device_is_available(const void *blob, unsigned long node); =20 diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index dceaf19f31fb..801451d034fa 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -265,16 +265,15 @@ static void __init __rmem_check_for_overlap(void) } =20 /** - * fdt_scan_reserved_mem_reg_nodes() - Store info for the "reg" defined - * reserved memory regions. + * fdt_scan_reserved_mem_late() - Scan FDT and initialize remaining reserv= ed + * memory regions. * - * This function is used to scan through the DT and store the - * information for the reserved memory regions that are defined using - * the "reg" property. The region node number, name, base address, and - * size are all stored in the reserved_mem array by calling the - * fdt_reserved_mem_save_node() function. + * This function is used to scan again through the DT and initialize the + * "static" reserved memory regions, that are defined using the "reg" + * property. Each such region is then initialized with its specific init + * function and stored in the global reserved_mem array. */ -void __init fdt_scan_reserved_mem_reg_nodes(void) +void __init fdt_scan_reserved_mem_late(void) { const void *fdt =3D initial_boot_params; phys_addr_t base, size; @@ -328,7 +327,14 @@ void __init fdt_scan_reserved_mem_reg_nodes(void) static int __init __reserved_mem_alloc_size(unsigned long node, const char= *uname); =20 /* - * fdt_scan_reserved_mem() - scan a single FDT node for reserved memory + * fdt_scan_reserved_mem() - reserve and allocate memory occupied by + * reserved memory regions. + * + * This function is used to scan through the FDT and mark memory occupied + * by all static (defined by the "reg" property) reserved memory regions. + * Then memory for all dynamic regions (defined by size & alignment) is + * allocated, a region specific init function is called and region informa= tion + * is stored in the reserved_mem array. */ int __init fdt_scan_reserved_mem(void) { --=20 2.34.1