Skip to content

Commit f8ea950

Browse files
linuswgregkh
authored andcommitted
misc/genalloc: Name subpools by of_node_full_name()
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: 21e5a2d ("misc: sram: Generate unique names for subpools") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20230622074520.3058027-1-linus.walleij@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 645bb6b commit f8ea950

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/misc/sram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static int sram_reserve_regions(struct sram_dev *sram, struct resource *res)
236236
}
237237
if (!label)
238238
block->label = devm_kasprintf(sram->dev, GFP_KERNEL,
239-
"%s", dev_name(sram->dev));
239+
"%s", of_node_full_name(child));
240240
else
241241
block->label = devm_kstrdup(sram->dev,
242242
label, GFP_KERNEL);

lib/genalloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ struct gen_pool *of_gen_pool_get(struct device_node *np,
895895

896896
of_property_read_string(np_pool, "label", &name);
897897
if (!name)
898-
name = np_pool->name;
898+
name = of_node_full_name(np_pool);
899899
}
900900
if (pdev)
901901
pool = gen_pool_get(&pdev->dev, name);

0 commit comments

Comments
 (0)