Skip to content

Commit

Permalink
misc/genalloc: Name subpools by of_node_full_name()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Fixes: 21e5a2d ("misc: sram: Generate unique names for subpools")
Signed-off-by: Linus Walleij <[email protected]>
Tested-by: Dmitry Osipenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
linusw authored and gregkh committed Jul 26, 2023
1 parent 645bb6b commit f8ea950
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/misc/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion lib/genalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f8ea950

Please sign in to comment.