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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 May 2022 22:23:16 +0200
From:   Rafał Miłecki <zajec5@...il.com>
To:     Ansuel Smith <ansuelsmth@...il.com>,
        Miquel Raynal <miquel.raynal@...tlin.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Manivannan Sadhasivam <mani@...nel.org>,
        linux-mtd@...ts.infradead.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [RESEND PATCH v3 0/2] Add nvmem support for dynamic partitions

On 29.04.2022 14:48, Ansuel Smith wrote:
> This very small series comes to fix the very annyoing problem of
> partitions declared by parser at runtime NOT supporting nvmem cells
> definition.
> 
> The current implementation is very generic. The idea is to provide an of
> node if defined for everyone and not strictly limit this to nvmem stuff.
> But still the actual change is done only for nvmem-cells mtd. (just to
> make sure) This can totally change by removing the compatible check.
> 
> The idea here is that a user can still use these dynamic parsers
> instead of declaring a fixed-partition and also declare how nvmem-cells
> are defined for the partition.
> This live with the assumption that dynamic partition have always the
> same name and they are known. (this is the case for smem-part partition
> that would require a bootloader reflash to change and for parsers like
> cmdlinepart where the name is always the same.)
> With this assumption, it's easy to fix this problem. Just introduce a
> new partition node that will declare just these special partition.
> Mtdcore then will check if these special declaration are present and
> connect the dynamic partition with the OF node present in the dts. Nvmem
> will automagically fin the OF node and cells will be works based on the
> data provided by the parser.
> 
> The initial idea was to create a special nvmem driver with a special
> compatible where a user would declare the mtd partition name and this
> driver would search it and register the nvmem cells but that became
> difficult really fast, mtd notifier system is problematic for this kind
> of stuff. So here is the better implementation. A variant of this is
> already tested on openwrt where we have devices that use cmdlinepart.
> (that current variant have defined in the dts the exact copy of
> cmdlinepart in the fixed-partition scheme and we patched the cmdlinepart
> parser to scan this fixed-partition node (that is ignored as cmdlinepart
> have priority) and connect the dynamic partition with the dts node)
> 
> I provided an example of this in the documentation commit.
> In short it's needed to add to the partitions where the compatible parser
> is declared, a partition with just the label declared (instead of the reg).
> Then declare some nvmem-cells and it will all work at runtime.
> Mtdcore will check if a node with the same label is present and assign an
> OF node to the MTD.
> 
> I currently tested this on my device that have smem-part and the
> gmac driver use nvmem to get the mac-address. This works correctly and
> the same address is provided.

Thanks a lot for working on this.

Another case (that I need this work for) is cmdline parser. Some
partitions passed by U-Boot may require extra handling and that needs to
be described in DT.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ