From: Dmitry Osipenko <digetx@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] misc/genalloc: Name subpools by of_node_full_name()
Date: Thu, 22 Jun 2023 14:38:48 +0300 [thread overview]
Message-ID: <a8d2bde9-174c-afed-f0e5-ed1ed2d1df0d@gmail.com> (raw)
In-Reply-To: <20230622074520.3058027-1-linus.walleij@linaro.org>
22.06.2023 10:45, Linus Walleij пишет:
> A previous commit tried to come up with more generic subpool
> names, but this isn't quite working: the node name was used
> elsewhere to match pools to consumers which regressed the
> nVidia Tegra 2/3 video decoder.
>
> Revert back to an earlier approach using of_node_full_name()
> instead of just the name to make sure the pool name is more
> unique, and change both sites using this in the kernel.
>
> It is not perfect since two SRAM nodes could have the same
> subpool name but it makes the situation better than before.
>
> Reported-by: Dmitry Osipenko <digetx@gmail.com>
> Fixes: 21e5a2d10c8f ("misc: sram: Generate unique names for subpools")
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/misc/sram.c | 2 +-
> lib/genalloc.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c
> index 5757adf418b1..61209739dc43 100644
> --- a/drivers/misc/sram.c
> +++ b/drivers/misc/sram.c
> @@ -236,7 +236,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
> }
> if (!label)
> block->label = devm_kasprintf(sram->dev, GFP_KERNEL,
> - "%s", dev_name(sram->dev));
> + "%s", of_node_full_name(child));
> else
> block->label = devm_kstrdup(sram->dev,
> label, GFP_KERNEL);
> diff --git a/lib/genalloc.c b/lib/genalloc.c
> index 0c883d6fbd44..6c644f954bc5 100644
> --- a/lib/genalloc.c
> +++ b/lib/genalloc.c
> @@ -895,7 +895,7 @@ struct gen_pool *of_gen_pool_get(struct device_node *np,
>
> of_property_read_string(np_pool, "label", &name);
> if (!name)
> - name = np_pool->name;
> + name = of_node_full_name(np_pool);
> }
> if (pdev)
> pool = gen_pool_get(&pdev->dev, name);
Works great, thanks!
Tested-by: Dmitry Osipenko <digetx@gmail.com>
next prev parent reply other threads:[~2023-06-22 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-22 7:45 Linus Walleij
2023-06-22 11:38 ` Dmitry Osipenko [this message]
2023-07-16 7:44 ` Linus Walleij
2023-07-16 8:13 ` Greg Kroah-Hartman
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=a8d2bde9-174c-afed-f0e5-ed1ed2d1df0d@gmail.com \
--to=digetx@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.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
Powered by JetHome