All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jens Axboe" <axboe@kernel.dk>, �ecki <rafal@milecki.pl>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] dt-bindings: mtd: partitions: Support label only partition
Date: Fri, 10 Jun 2022 11:02:05 -0600	[thread overview]
Message-ID: <20220610170205.GD1787330-robh@kernel.org> (raw)
In-Reply-To: <62a250c4.1c69fb81.addd2.0eae@mx.google.com>

On Thu, Jun 09, 2022 at 09:57:52PM +0200, Ansuel Smith wrote:
> On Thu, Jun 09, 2022 at 12:32:52PM -0600, Rob Herring wrote:
> > On Mon, Jun 06, 2022 at 05:14:15PM +0200, Ansuel Smith wrote:
> > > Document new partition nodes that declare only the label instead of the
> > > reg used to provide an OF node for partition registred at runtime by
> > > parsers. This is required for nvmem system to declare and detect
> > > nvmem-cells.
> > > 
> > > With these special partitions, the reg / offset is not required.
> > > The label binding is used to match the partition allocated by the
> > > parser at runtime and the parser will provide reg and offset of the mtd.
> > > 
> > > NVMEM will use the data from the parser and provide the NVMEM cells
> > > declared in the DTS, "connecting" the dynamic partition with a
> > > static declaration of cells in them.
> > > 
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > > ---
> > >  .../bindings/mtd/partitions/partition.yaml       | 16 ++++++++++++++--
> > >  1 file changed, 14 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > index e1ac08064425..bff6fb980e6b 100644
> > > --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > @@ -11,6 +11,13 @@ description: |
> > >    relative offset and size specified. Depending on partition function extra
> > >    properties can be used.
> > >  
> > > +  A partition may be dynamically allocated by a specific parser at runtime.
> > > +  In this specific case, the label is required instead of the reg.
> > > +  This is used to assign an OF node to the dynamiccally allocated partition
> > > +  so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
> > > +  The OF node will be assigned only if the partition label declared match the
> > > +  one assigned by the parser at runtime.
> > > +
> > >  maintainers:
> > >    - Rafał Miłecki <rafal@milecki.pl>
> > >  
> > > @@ -22,6 +29,8 @@ properties:
> > >    label:
> > >      description: The label / name for this partition. If omitted, the label
> > >        is taken from the node name (excluding the unit address).
> > > +      With dynamically allocated partition the label is required and won't
> > > +      fallback to the node name.
> > 
> > Generally, label is never required being something for humans rather 
> > than the s/w to consume. I don't see any reason why we can't still use 
> > the node name (with 'partition-' stripped off).
> > 
> 
> How to enforce the use of 'partition-'? Should the driver then check the
> node name and reject any wrong node name (and return error)?

The schema can do it either in the parent (of partition nodes) schema or 
with $nodename 'property'.

$nodename:
  oneOf:
    - pattern: '^.*@.*$'
    - pattern: '^partition-.*$'

or:

if:
  not:
    required:
      - reg
then:
  properties:
    $nodename:
      pattern: '^partition-.*$'


The latter is a bit clearer on the intent I think.

> > If the purpose is to define what the partition contains, then 
> > 'compatible' is the right thing for that.
> >
> 
> Introducing a compatible means creating another scheme I think or we can
> add that special compatible in the partition scheme?

It would be another schema. You could make 'compatible' required here 
perhaps, but maybe there's a use for an empty node?

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Ansuel Smith <ansuelsmth@gmail.com>
Cc: "Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Jens Axboe" <axboe@kernel.dk>, �ecki <rafal@milecki.pl>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	linux-mtd@lists.infradead.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/3] dt-bindings: mtd: partitions: Support label only partition
Date: Fri, 10 Jun 2022 11:02:05 -0600	[thread overview]
Message-ID: <20220610170205.GD1787330-robh@kernel.org> (raw)
In-Reply-To: <62a250c4.1c69fb81.addd2.0eae@mx.google.com>

On Thu, Jun 09, 2022 at 09:57:52PM +0200, Ansuel Smith wrote:
> On Thu, Jun 09, 2022 at 12:32:52PM -0600, Rob Herring wrote:
> > On Mon, Jun 06, 2022 at 05:14:15PM +0200, Ansuel Smith wrote:
> > > Document new partition nodes that declare only the label instead of the
> > > reg used to provide an OF node for partition registred at runtime by
> > > parsers. This is required for nvmem system to declare and detect
> > > nvmem-cells.
> > > 
> > > With these special partitions, the reg / offset is not required.
> > > The label binding is used to match the partition allocated by the
> > > parser at runtime and the parser will provide reg and offset of the mtd.
> > > 
> > > NVMEM will use the data from the parser and provide the NVMEM cells
> > > declared in the DTS, "connecting" the dynamic partition with a
> > > static declaration of cells in them.
> > > 
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > > ---
> > >  .../bindings/mtd/partitions/partition.yaml       | 16 ++++++++++++++--
> > >  1 file changed, 14 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > index e1ac08064425..bff6fb980e6b 100644
> > > --- a/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > +++ b/Documentation/devicetree/bindings/mtd/partitions/partition.yaml
> > > @@ -11,6 +11,13 @@ description: |
> > >    relative offset and size specified. Depending on partition function extra
> > >    properties can be used.
> > >  
> > > +  A partition may be dynamically allocated by a specific parser at runtime.
> > > +  In this specific case, the label is required instead of the reg.
> > > +  This is used to assign an OF node to the dynamiccally allocated partition
> > > +  so that subsystem like NVMEM can provide an OF node and declare NVMEM cells.
> > > +  The OF node will be assigned only if the partition label declared match the
> > > +  one assigned by the parser at runtime.
> > > +
> > >  maintainers:
> > >    - Rafał Miłecki <rafal@milecki.pl>
> > >  
> > > @@ -22,6 +29,8 @@ properties:
> > >    label:
> > >      description: The label / name for this partition. If omitted, the label
> > >        is taken from the node name (excluding the unit address).
> > > +      With dynamically allocated partition the label is required and won't
> > > +      fallback to the node name.
> > 
> > Generally, label is never required being something for humans rather 
> > than the s/w to consume. I don't see any reason why we can't still use 
> > the node name (with 'partition-' stripped off).
> > 
> 
> How to enforce the use of 'partition-'? Should the driver then check the
> node name and reject any wrong node name (and return error)?

The schema can do it either in the parent (of partition nodes) schema or 
with $nodename 'property'.

$nodename:
  oneOf:
    - pattern: '^.*@.*$'
    - pattern: '^partition-.*$'

or:

if:
  not:
    required:
      - reg
then:
  properties:
    $nodename:
      pattern: '^partition-.*$'


The latter is a bit clearer on the intent I think.

> > If the purpose is to define what the partition contains, then 
> > 'compatible' is the right thing for that.
> >
> 
> Introducing a compatible means creating another scheme I think or we can
> add that special compatible in the partition scheme?

It would be another schema. You could make 'compatible' required here 
perhaps, but maybe there's a use for an empty node?

Rob

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2022-06-10 17:02 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-06 15:14 [PATCH v5 0/3] Add nvmem support for dynamic partitions Ansuel Smith
2022-06-06 15:14 ` Ansuel Smith
2022-06-06 15:14 ` [PATCH v5 1/3] dt-bindings: mtd: partitions: Support label only partition Ansuel Smith
2022-06-06 15:14   ` Ansuel Smith
2022-06-09 18:32   ` Rob Herring
2022-06-09 18:32     ` Rob Herring
2022-06-09 19:57     ` Ansuel Smith
2022-06-09 19:57       ` Ansuel Smith
2022-06-10 17:02       ` Rob Herring [this message]
2022-06-10 17:02         ` Rob Herring
2022-06-11 12:36         ` Ansuel Smith
2022-06-11 12:36           ` Ansuel Smith
2022-06-13 19:25         ` Ansuel Smith
2022-06-13 19:25           ` Ansuel Smith
2022-06-06 15:14 ` [PATCH v5 2/3] dt-bindings: mtd: partitions: add additional example for qcom,smem-part Ansuel Smith
2022-06-06 15:14   ` Ansuel Smith
2022-06-09 18:33   ` Rob Herring
2022-06-09 18:33     ` Rob Herring
2022-06-06 15:14 ` [PATCH v5 3/3] mtd: core: introduce of support for dynamic partitions Ansuel Smith
2022-06-06 15:14   ` Ansuel Smith
2022-06-08 15:44   ` [mtd] a2af0cae87: BUG:kernel_NULL_pointer_dereference,address kernel test robot
2022-06-08 15:44     ` kernel test robot
2022-06-08 15:44     ` kernel test robot
2022-06-09 12:35     ` Miquel Raynal
2022-06-09 12:35       ` [mtd] a2af0cae87: BUG:kernel_NULL_pointer_dereference, address Miquel Raynal
2022-06-09 12:35       ` [mtd] a2af0cae87: BUG:kernel_NULL_pointer_dereference,address Miquel Raynal
2022-10-17 19:59   ` [PATCH v5 3/3] mtd: core: introduce of support for dynamic partitions han.xu
2022-10-17 19:59     ` han.xu
2022-10-17 21:52     ` Rafał Miłecki
2022-10-17 21:52       ` Rafał Miłecki
2022-10-18  2:48       ` han.xu
2022-10-18  2:48         ` han.xu

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=20220610170205.GD1787330-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=ansuelsmth@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mani@kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.