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]
Date:   Tue, 14 Jan 2020 10:24:32 +0100
From:   Miquel Raynal <miquel.raynal@...tlin.com>
To:     Rob Herring <robh+dt@...nel.org>
Cc:     Boris Brezillon <boris.brezillon@...labora.com>,
        Richard Weinberger <richard@....at>,
        Vignesh Raghavendra <vigneshr@...com>,
        Tudor Ambarus <Tudor.Ambarus@...rochip.com>,
        Mark Rutland <mark.rutland@....com>,
        <linux-mtd@...ts.infradead.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Mark Brown <broonie@...nel.org>,
        Paul Kocialkowski <paul.kocialkowski@...tlin.com>,
        Bernhard Frauendienst <kernel@...pam.obeliks.de>
Subject: Re: [PATCH v5 4/4] mtd: Add driver for concatenating devices

Hi Rob,

Boris Brezillon <boris.brezillon@...labora.com> wrote on Mon, 9 Dec
2019 11:35:06 +0100:

> On Wed, 27 Nov 2019 11:55:22 +0100
> Miquel Raynal <miquel.raynal@...tlin.com> wrote:
> 
> > Introduce a generic way to define concatenated MTD devices. This may
> > be very useful in the case of ie. stacked SPI-NOR. Partitions to
> > concatenate are described in an additional property of the partitions
> > subnode:
> > 
> >         flash0 {
> >                 partitions {
> >                         compatible = "fixed-partitions";
> >                         part-concat = <&flash0_part1>, <&flash1_part0>;
> > 
> > 			part0@0 {
> > 				label = "part0_0";
> > 				reg = <0x0 0x800000>;
> > 			};
> > 
> > 			flash0_part1: part1@...000 {
> > 				label = "part0_1";
> > 				reg = <0x800000 0x800000>;  
> 
> So, flash0_part1 and flash0_part2 will be created even though the user
> probably doesn't need them?
> 
> > 			};
> >                 };
> >         };
> > 
> >         flash1 {
> >                 partitions {
> >                         compatible = "fixed-partitions";
> > 
> > 			flash0_part1: part1@0 {
> > 				label = "part1_0";
> > 				reg = <0x0 0x800000>;
> > 			};
> > 
> > 			part0@...000 {
> > 				label = "part1_1";
> > 				reg = <0x800000 0x800000>;
> > 			};
> >                 };
> >         };  
> 
> IMHO this representation is far from intuitive. At first glance it's not
> obvious which partitions are linked together and what's the name of the
> resulting concatenated part. I definitely prefer the solution where we
> have a virtual device describing the concatenation. I also understand
> that this goes against the #1 DT rule: "DT only decribes HW blocks, not
> how they should be used/configured", but maybe we can find a compromise
> here, like moving this description to the /chosen node?
> 
> chosen {
> 	flash-arrays {
> 		/*
> 		 * my-flash-array is the MTD name if label is
> 		 * not present.
> 		 */
> 		my-flash-array {
> 			/*
> 			 * We could have
> 			 * compatible = "flash-array";
> 			 * but we can also do without it.
> 			 */
> 			label = "foo";
> 			flashes = <&flash1 &flash2 ...>;
> 			partitions {
> 				/* usual partition description. */
> 				...
> 			};
> 		};
> 	};
> };
> 
> Rob, what do you think?

Rob, I would really welcome your thoughts on this solution, having
something like a flash-array node in the /chosen/ node would avoid
creating dummy devices, keep the declarations of the physical nodes
tidy and have a very simple description.

Hope this compromise could fit!
 
> 
> > 
> > This is useful for boards where memory range has been extended with
> > the use of multiple flash chips as memory banks of a single MTD
> > device, with partitions spanning chip borders.
> > 
> > Suggested-by: Bernhard Frauendienst <kernel@...pam.obeliks.de>
> > Signed-off-by: Miquel Raynal <miquel.raynal@...tlin.com>

Thanks,
Miquèl

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ