schemas: reserved-memory: clarify reg supports a single entry only#197
Merged
Conversation
The existing description is internally inconsistent. The opening sentence says "Each child of the reserved-memory node specifies one or more regions of reserved memory", but the next sentence narrows this to a singular form: "Each child node may either use a 'reg' property to specify a specific range of reserved memory, or a 'size' property ... to request a dynamically allocated block of memory" Multiple entries in 'reg' have never been fully functional in the Linux kernel, so drop the "one or more" wording and add 'maxItems: 1' to the reg property. Suggested-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/all/20260506014752.GA280279-robh@kernel.org/ Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
mj22226
pushed a commit
to mj22226/linux
that referenced
this pull request
Jun 3, 2026
A /reserved-memory child node may have multiple <base size> tuples in
'reg' property, but multiple entries in 'reg' have never been fully
functional:
- fdt_scan_reserved_mem() in the early pass loops over every
tuple and reserves them all.
- fdt_scan_reserved_mem_late() reads 'reg' by
of_flat_dt_get_addr_size(), which returns false if entries != 1.
So 'reg' property with multiple <base size> entries will be
skipped, no reserved_mem entry is created in reserved_mem[].
Supporting multiple <base size> tuples is not a good idea:
- It requires reserved_mem_ops->node_init support. Currently,
CMA(rmem_cma_setup) and DMA(rmem_dma_setup) are not supported.
- of_reserved_mem_lookup() is name-based, only the first entry in
multiple <base size> tuples will be found.
So change to support one <base size> entry in 'reg' property.
Also update dt binding:
devicetree-org/dt-schema#197
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
Tested-by: Meijing Zhao <zhaomeijing@lixiang.com>
Link: https://lore.kernel.org/all/20260506014752.GA280279-robh@kernel.org/
Link: https://patch.msgid.link/20260525121700.2706141-1-chenwandun1@gmail.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing description is internally inconsistent. The opening sentence says "Each child of the reserved-memory node specifies one or more regions of reserved memory", but the next sentence narrows this to a singular form: "Each child node may either use a 'reg' property to specify a specific range of reserved memory, or a 'size' property ... to request a dynamically allocated block of memory"
Multiple entries in 'reg' have never been fully functional in the Linux kernel, so drop the "one or more" wording and add 'maxItems: 1' to the reg property.
Suggested-by: Rob Herring robh@kernel.org
Link: https://lore.kernel.org/all/20260506014752.GA280279-robh@kernel.org/
The corresponding Linux kernel support is under review on LKML
( https://lore.kernel.org/lkml/20260525121700.2706141-1-chenwandun1@gmail.com/)