mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rob Herring (Arm)" <robh@kernel.org>
To: Wandun Chen <chenwandun1@gmail.com>
Cc: linux-kernel@vger.kernel.org, saravanak@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [PATCH v3] of: reserved_mem: only support one <base size> entry in reg property
Date: Tue, 2 Jun 2026 10:18:12 -0500	[thread overview]
Message-ID: <178041345940.355357.208300843136248973.robh@kernel.org> (raw)
In-Reply-To: <20260525121700.2706141-1-chenwandun1@gmail.com>


On Mon, 25 May 2026 20:17:00 +0800, Wandun Chen wrote:
> From: Wandun Chen <chenwandun@lixiang.com>
> 
> 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:
>   https://github.com/devicetree-org/dt-schema/pull/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/
> 
> ---
> v2 --> v3:
> 1. Fix out-of-bounds issue in v2 if device tree contains an empty reg
>    property [1].
> 
> v1 --> v2:
> 1. Support only one entry in reg property, suggested by
>    Rob Herring [2].
> 
> [1] https://sashiko.dev/#/patchset/20260519082427.4181476-1-chenwandun%40lixiang.com?part=3
> [2] https://lore.kernel.org/all/20260429065831.1510858-1-chenwandun@lixiang.com/T/#m29fa0f1c22c23e6343070e70f905c9482f930901
> ---
>  drivers/of/of_reserved_mem.c | 43 ++++++++++++++++++++----------------
>  1 file changed, 24 insertions(+), 19 deletions(-)
> 

Applied, thanks!


      reply	other threads:[~2026-06-02 15:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-25 12:17 Wandun Chen
2026-06-02 15:18 ` Rob Herring (Arm) [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178041345940.355357.208300843136248973.robh@kernel.org \
    --to=robh@kernel.org \
    --cc=chenwandun1@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saravanak@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®