devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: Ansuel Smith <ansuelsmth@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	devicetree@vger.kernel.org, Vignesh Raghavendra <vigneshr@ti.com>,
	Boris Brezillon <bbrezillon@kernel.org>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible
Date: Fri, 5 Mar 2021 16:23:00 -0600	[thread overview]
Message-ID: <20210305222300.GA718014@robh.at.kernel.org> (raw)
In-Reply-To: <1cf374f1-09d5-9fa9-9b0d-d8079f2f6fbc@gmail.com>

On Wed, Mar 03, 2021 at 11:01:55AM +0100, Rafał Miłecki wrote:
> [Rob: please advise]
> 
> On 16.02.2021 22:26, Ansuel Smith wrote:
> > Document nvmem-partitions compatible used to treat mtd partitions as a
> > nvmem provider.
> 
> Until now we were using "compatible" string in partition node only for
> parsers (looking for subpartitions). We need to think if this change can
> break anything from DT / Linux perspective.
> 
> Compatible strings should be unique, so there is no risk of conflict
> between NVMEM and parsers.
> 
> Now: can we ever need mtd partition to:
> 1. Contain subpartitions
> 2. Provide NVMEM
> at the same time?
> 
> Let's say:
> 
> partition@0 {
> 	compatible = "vendor,dynamic-firmware-partitions", "nvmem-partitions";

I think you'd want the "vendor,dynamic-firmware-partitions" parser/code 
to serve up any nvmem regions. Whether you have a fallback here depends 
if an OS could make use of the regions knowing nothing about 
"vendor,dynamic-firmware-partitions".

> 	label = "firmware";
> 	reg = <0x0 0x100000>;
> 	#address-cells = <1>;
> 	#size-cells = <1>;
> 	ranges = <0 0x0 0x100000>;
> 
> 	firmware-version@10 {
> 		reg = <0x10 0x4>;
> 	};
> 
> 	firmware-date@10 {
> 		reg = <0x20 0x4>;
> 	};
> };
> 
> Is that allowed to respect both "compatible" strings and have:
> 1. Linux parser parse "firmware" for subpartitions
> 2. Linux MTD register "firmware" as NVMEM device
> ?
> 
> If not, what other options do we have? Is that allowed to have a
> dangling MTD NVMEM node with phandle to MTD partition?
> 
> firmware: partition@0 {
> 	compatible = "vendor,dynamic-firmware-partitions";
> 	label = "firmware";
> 	reg = <0x0 0x100000>;
> };
> 
> (...)
> 
> firmware-version@10 {
> 	compatible = "mtd-nvmem";
> 	reg = <0x10 0x4>;
> 	mtd = <&firmware>;
> };
> 
> firmware-date@10 {
> 	compatible = "mtd-nvmem";
> 	reg = <0x20 0x4>;
> 	mtd = <&firmware>;
> };

This, I would not like to see.

Rob

  reply	other threads:[~2021-03-05 22:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 21:26 [PATCH v2 0/3] Implement nvmem support for mtd Ansuel Smith
2021-02-16 21:26 ` [PATCH v2 1/3] mtd: partitions: ofpart: skip subnodes parse with compatible Ansuel Smith
2021-03-02 16:53   ` Rafał Miłecki
2021-03-02  4:50     ` Ansuel Smith
2021-02-16 21:26 ` [PATCH v2 2/3] mtd: core: add nvmem-partitions compatible to parse mtd as nvmem cells Ansuel Smith
2021-03-03  8:01   ` Rafał Miłecki
2021-02-16 21:26 ` [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible Ansuel Smith
2021-03-03 10:01   ` Rafał Miłecki
2021-03-05 22:23     ` Rob Herring [this message]
2021-03-08  9:45       ` Rafał Miłecki
2021-03-08  9:48   ` Rafał Miłecki
2021-03-07 17:04     ` Ansuel Smith
2021-03-08 13:28       ` Rafał Miłecki
2021-03-08 13:32       ` Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210305222300.GA718014@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=bbrezillon@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).