lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <vrcxh2o88nbias.fsf@plvision.eu>
Date:   Mon, 20 Sep 2021 14:25:15 +0300
From:   Vadym Kochan <vadym.kochan@...ision.eu>
To:     Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc:     Vadym Kochan <vadym.kochan@...ision.eu>,
        Rob Herring <robh+dt@...nel.org>, linux-kernel@...r.kernel.org,
        devicetree@...r.kernel.org, Robert Marko <robert.marko@...tura.hr>
Subject: Re: [PATCH v2 1/3] nvmem: core: introduce cells parser


Just to clarify regarding the interfaces:

Srinivas Kandagatla <srinivas.kandagatla@...aro.org> writes:

> On 20/09/2021 11:24, Vadym Kochan wrote:
>>>>
>>>> Probably this might be fixed by lookup nvmem device too ?
>>> Honestly, this approach is a total hack to get it working.
>>>
>>> This is what Am thinking which should look like:
>>>
>>> ## DT ##
>>> eeprom_at24: at24@56 {
>>> 	compatible = "atmel,24c32";
>>> 	/* Some way to identify that this is a TLV data */
>>> 	nvmem-cell-parser-name = "onie-tlv-cells";
>>> 	reg = <0x56>;
>>>
>>> 	mac_address: mac-address {
>>> 		/* THIS REG is updated once TLV is parsed */
>>> 		reg = <0 0x6>
>>> 	};
>> I assume these cell nodes should be marked with some property that they
>> should be evaluated later, so the cell will be not read
>> in case it was not parsed because it may
>> exist in nvmem device optionally.
> No, we should hit that use case to start with.
>
> nvmem cells are parsed in the core during register path.
> Parser should parse the cells before this to keep it simple.
>
>> 
>> Or, treat cells with length "0" in a special way and allow to update
>> cell info later.you can update irrespective of the length, as long as this is done 
> before register.
>
>
>> 
>>> };
>>>
>>> some_dev_node {
>>> 	compatible = "xxx";
>>> 	nvmem-cells = <&mac_address>;
>>> 	nvmem-cell-names = "mac-address";
>>> };
>>>
>>> == CODE ==
>>> ret = of_get_mac_address(dev->of_node, base_mac);
>>> ==========
>>>
>>>
>>> If you notice the mac_address node reg is 0.
>>> This node "reg" property should be updated ( using of_update_property())
>>> by nvmem-provider driver while tlv parsing and by matching the node name
>>> with tlv name.
>>>
>> I assume parser driver can just invoke add_cell_table (with may be
>> by adding 'bool update' field to the cell_info struct) and core.c will just
>> update existing cells parsed from OF.
>> 
>
> Lets keep the core code clean for now, I would expect the provider 
> driver along with parser function to do update the nodes.
>
> --srini
>

core.c sequence:

1) after cells parsed from OF:

2) lookup the parser

3) parser->cells_parse(ctx, table)

3.a) update existing cells matched by name from table

4) parser->cells_clean(ctx, table)
/* to free cell's_info allocated by the parser driver */

as alternative way, I think it would be more generic to
provide nvmem-provider.h API to update the existing cell info,
however it makes sense only when cells were parsed
by the cell parser, in the other situations the
cell should be well defined.

with this approach the parser driver will be just called
via parser->cells_parse(ctx) and will call nvmem_cell_info_update()
for each parsed cells.

>>> That way rest of the code will work as usual.
>>>
>>> If this work for you then we can ask Rob if he foresee any issues in
>>> this approach. I already see similar usage in reserved-memory case.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ