[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <yxxk4cffjm7rx2pbndibrp7a6txmi4urnrt5bipr24z7dlstk7@sybqp3gp6gqi>
Date: Tue, 29 Jul 2025 14:24:27 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Jon Hunter <jonathanh@...dia.com>
Cc: "Rob Herring (Arm)" <robh@...nel.org>, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] firmware: tegra: bpmp: Use
of_reserved_mem_region_to_resource() for "memory-region"
On Mon, Jul 28, 2025 at 03:17:11PM +0100, Jon Hunter wrote:
> Hi Rob, Thierry,
>
> On 03/07/2025 19:34, Rob Herring (Arm) wrote:
> > Use the newly added of_reserved_mem_region_to_resource() function to
> > handle "memory-region" properties.
> >
> > Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> > ---
> > drivers/firmware/tegra/bpmp-tegra186.c | 9 ++-------
> > 1 file changed, 2 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/firmware/tegra/bpmp-tegra186.c b/drivers/firmware/tegra/bpmp-tegra186.c
> > index 6f0d0511b486..7cfc5fdfa49d 100644
> > --- a/drivers/firmware/tegra/bpmp-tegra186.c
> > +++ b/drivers/firmware/tegra/bpmp-tegra186.c
> > @@ -6,7 +6,7 @@
> > #include <linux/genalloc.h>
> > #include <linux/io.h>
> > #include <linux/mailbox_client.h>
> > -#include <linux/of_address.h>
> > +#include <linux/of_reserved_mem.h>
> > #include <linux/platform_device.h>
> > #include <soc/tegra/bpmp.h>
> > @@ -192,16 +192,11 @@ static void tegra186_bpmp_teardown_channels(struct tegra_bpmp *bpmp)
> > static int tegra186_bpmp_dram_init(struct tegra_bpmp *bpmp)
> > {
> > struct tegra186_bpmp *priv = bpmp->priv;
> > - struct device_node *np;
> > struct resource res;
> > size_t size;
> > int err;
> > - np = of_parse_phandle(bpmp->dev->of_node, "memory-region", 0);
> > - if (!np)
> > - return -ENODEV;
> > -
> > - err = of_address_to_resource(np, 0, &res);
> > + err = of_reserved_mem_region_to_resource(bpmp->dev->of_node, 0, &res);
> > if (err < 0) {
> > dev_warn(bpmp->dev, "failed to parse memory region: %d\n", err);
> > return err;
>
>
> This change is now causing the following warning to be observed on Tegra194
> Jetson AGX Xavier platform ...
>
> WARNING KERN tegra-bpmp bpmp: failed to parse memory region: -19
>
> Looking at the binding only one of 'memory-region' or 'shmem' is required
> and for Tegra194 we are using shmem. So I am not sure if it is worth making
> this change for this driver.
I guess the change still makes sense for merging both calls into one but
we now need to check for -ENODEV and not warn about it for this to
remain really equivalent.
I can patch it up.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists