Re: [PATCH v2 2/2] misc: sram: Generate unique names for subpools

From: Linus Walleij
Date: Mon Jun 19 2023 - 03:11:39 EST


On Sun, Jun 18, 2023 at 11:33 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote:

> > if (!label)
> > - label = child->name;
> > -
> > - block->label = devm_kstrdup(sram->dev,
> > - label, GFP_KERNEL);
> > + block->label = devm_kasprintf(sram->dev, GFP_KERNEL,
> > + "%s", dev_name(sram->dev));
>
> This broke device-trees that have no label property.

Which system is affected? Asking so I can inspect the DTS file
and figure out how this needs to work.

> The SRAM DT binding says:
>
> "
> label:
> description:
> The name for the reserved partition, if omitted, the label is taken
> from the node name excluding the unit address.
> "
>
> Not sure whether breakage was on purpose, otherwise doc needs to be
> updated or there should be explicit check for the duplicated node names.
>
> Secondly, AFAICS, the dev_name(sram->dev) is the name of the parent SRAM
> device and not of the children sub-nodes, hence it's now always the same
> dev_name(sram->dev) for all sub-nodes.

Sounds like I should go back to the original approach in patch v1:
https://lore.kernel.org/linux-devicetree/20230417-ux500-sram-v1-2-5924988bb835@xxxxxxxxxx/

and also augment the DTS binding text to say it uses the full node name
including the address.

Does that look OK to you, or will this regress your system as well?

Yours,
Linus Walleij