devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Ayush Singh <ayush@beagleboard.org>
Cc: David Gibson <david@gibson.dropbear.id.au>,
	Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Saravana Kannan <saravanak@google.com>,
	devicetree@vger.kernel.org, devicetree-compiler@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v2 5/7] of: overlay: Add export_symbols_name in of_overlay_fdt_apply() parameters
Date: Mon, 5 May 2025 10:17:57 +0200	[thread overview]
Message-ID: <20250505101757.0b294b63@bootlin.com> (raw)
In-Reply-To: <dba95e76-3d60-41ef-b98c-5aedee808dd9@beagleboard.org>

Hi Ayush,

On Fri, 2 May 2025 20:10:41 +0530
Ayush Singh <ayush@beagleboard.org> wrote:

> On 4/30/25 18:21, Herve Codina wrote:
> 
> > In order to prepare the introduction of the export symbols node
> > handling, add a export_symbols_name parameter in of_overlay_fdt_apply().
> >
> > The export_symbols_name is the name of the export symbols subnode
> > available in the base node that will be used by the resolver to handle
> > export symbols resolution.
> >
> > Having the name of the subnode in parameters instead of the subnode
> > itself avoids the use of an export symbol node that is not directly
> > related to the base node.
> >
> > Signed-off-by: Herve Codina <herve.codina@bootlin.com>
> > Tested-by: Ayush Singh <ayush@beagleboard.org>
> > ---
> >   drivers/misc/lan966x_pci.c    | 3 ++-
> >   drivers/of/of_kunit_helpers.c | 2 +-
> >   drivers/of/overlay.c          | 7 ++++++-
> >   drivers/of/unittest.c         | 4 ++--
> >   include/linux/of.h            | 6 ++++--
> >   5 files changed, 15 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/misc/lan966x_pci.c b/drivers/misc/lan966x_pci.c
> > index 9c79b58137e5..f05cb040ec69 100644
> > --- a/drivers/misc/lan966x_pci.c
> > +++ b/drivers/misc/lan966x_pci.c
> > @@ -128,7 +128,8 @@ static int lan966x_pci_load_overlay(struct lan966x_pci *data)
> >   	u32 dtbo_size = __dtbo_lan966x_pci_end - __dtbo_lan966x_pci_begin;
> >   	void *dtbo_start = __dtbo_lan966x_pci_begin;
> >   
> > -	return of_overlay_fdt_apply(dtbo_start, dtbo_size, &data->ovcs_id, dev_of_node(data->dev));
> > +	return of_overlay_fdt_apply(dtbo_start, dtbo_size, &data->ovcs_id,
> > +				    dev_of_node(data->dev), NULL);
> >   }
> >   
> >   static void lan966x_pci_unload_overlay(struct lan966x_pci *data)
> > diff --git a/drivers/of/of_kunit_helpers.c b/drivers/of/of_kunit_helpers.c
> > index 7b3ed5a382aa..476b43474168 100644
> > --- a/drivers/of/of_kunit_helpers.c
> > +++ b/drivers/of/of_kunit_helpers.c
> > @@ -56,7 +56,7 @@ int of_overlay_fdt_apply_kunit(struct kunit *test, void *overlay_fdt,
> >   		return -ENOMEM;
> >   
> >   	ret = of_overlay_fdt_apply(overlay_fdt, overlay_fdt_size,
> > -				   ovcs_id, NULL);
> > +				   ovcs_id, NULL, NULL);
> >   	if (ret)
> >   		return ret;
> >   
> > diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> > index aa1b97e634aa..73ff38c41de2 100644
> > --- a/drivers/of/overlay.c
> > +++ b/drivers/of/overlay.c
> > @@ -968,6 +968,10 @@ static int of_overlay_apply(struct overlay_changeset *ovcs,
> >    * @overlay_fdt_size:	number of bytes in @overlay_fdt
> >    * @ret_ovcs_id:	pointer for returning created changeset id
> >    * @base:		pointer for the target node to apply overlay
> > + * @export_symbols_name:
> > + *			Name of the export symbol subnode of the @base node to
> > + *			provide extra symbols. Those extra symbols are used in
> > + *			the overlay symbols resolution.
> >    *
> >    * Creates and applies an overlay changeset.
> >    *
> > @@ -983,7 +987,8 @@ static int of_overlay_apply(struct overlay_changeset *ovcs,
> >    */
> >   
> >   int of_overlay_fdt_apply(const void *overlay_fdt, u32 overlay_fdt_size,
> > -			 int *ret_ovcs_id, const struct device_node *base)
> > +			 int *ret_ovcs_id, const struct device_node *base,
> > +			 const char *export_symbols_name)  
> 
> Do we really need the export-symbols node name to be configurable?

Well, it depends on the export-symbols acceptance in device-tree spec or some
other global device-tree bindings.

If this export-symbols node is accepted globally, the name is not needed and
shouldn't be configurable.

If this node name can be changed from one node binding to an other, having it
configurable is interesting.

That said, according to your work done at higher level (device-tree spec), this
name tends to be global. If confirmed, I will remove the export_symbols_name
parameter in the next iteration and use 'export-symbols' for all cases.

Best regards,
Hervé

  reply	other threads:[~2025-05-05  8:18 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30 12:51 [PATCH v2 0/7] of: overlay: Add support for export-symbols node feature Herve Codina
2025-04-30 12:51 ` [PATCH v2 1/7] dt-bindings: Add support for export-symbols node Herve Codina
2025-05-02 14:33   ` Luca Ceresoli
2025-05-27 18:31   ` Krzysztof Kozlowski
2025-05-28  7:59     ` Ayush Singh
2025-05-28  8:06       ` Krzysztof Kozlowski
2025-05-28 16:57     ` Herve Codina
2025-06-04 18:35       ` Krzysztof Kozlowski
2025-06-18  9:32         ` Herve Codina
2025-06-18  9:54           ` Ayush Singh
2025-07-04  9:10             ` Herve Codina
2025-08-17  7:41             ` Krzysztof Kozlowski
2025-08-17  8:18               ` Ayush Singh
2025-08-17  8:22                 ` Krzysztof Kozlowski
2025-08-17  8:42                   ` Ayush Singh
2025-08-18 17:05                     ` Rob Herring
2025-08-18 17:37                       ` Ayush Singh
2025-08-17  7:38           ` Krzysztof Kozlowski
2025-04-30 12:51 ` [PATCH v2 2/7] of: resolver: Introduce get_phandle_from_symbols_node() Herve Codina
2025-04-30 12:51 ` [PATCH v2 3/7] of: resolver: Add export_symbols in of_resolve_phandles() parameters Herve Codina
2025-05-02 14:35   ` Luca Ceresoli
2025-05-05  8:10     ` Herve Codina
2025-04-30 12:51 ` [PATCH v2 4/7] of: resolver: Add support for the export symbols node Herve Codina
2025-04-30 12:51 ` [PATCH v2 5/7] of: overlay: Add export_symbols_name in of_overlay_fdt_apply() parameters Herve Codina
2025-05-02 14:40   ` Ayush Singh
2025-05-05  8:17     ` Herve Codina [this message]
2025-04-30 12:51 ` [PATCH v2 6/7] of: overlay: Add support for the export symbols node Herve Codina
2025-04-30 12:51 ` [PATCH v2 7/7] of: unittest: Add tests for export symbols Herve Codina

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=20250505101757.0b294b63@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=afd@ti.com \
    --cc=arnd@arndb.de \
    --cc=ayush@beagleboard.org \
    --cc=conor+dt@kernel.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh@kernel.org \
    --cc=saravanak@google.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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;
as well as URLs for NNTP newsgroup(s).