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: <20240926140351.GA2596132-robh@kernel.org>
Date: Thu, 26 Sep 2024 09:03:51 -0500
From: Rob Herring <robh@...nel.org>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Jens Axboe <axboe@...nel.dk>, Jonathan Corbet <corbet@....net>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	Miquel Raynal <miquel.raynal@...tlin.com>,
	Richard Weinberger <richard@....at>,
	Vignesh Raghavendra <vigneshr@...com>,
	Simon Glass <sjg@...omium.org>,
	INAGAKI Hiroshi <musashino.open@...il.com>,
	Daniel Golle <daniel@...rotopia.org>,
	Al Viro <viro@...iv.linux.org.uk>,
	Christian Brauner <brauner@...nel.org>,
	Li Lingfeng <lilingfeng3@...wei.com>,
	Christian Heusel <christian@...sel.eu>,
	Rafał Miłecki <rafal@...ecki.pl>,
	linux-block@...r.kernel.org, linux-doc@...r.kernel.org,
	linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
	linux-mmc@...r.kernel.org, linux-mtd@...ts.infradead.org,
	Lorenzo Bianconi <lorenzo@...nel.org>
Subject: Re: [RFC PATCH v2 4/5] dt-bindings: block: Generalize and introduce
 property for partitions

On Wed, Sep 25, 2024 at 11:45:24PM +0200, Christian Marangi wrote:
> Generalize property from MTD partitions schema and introduce property for
> block partitions defined in OF.
> 
> Partition schema for block devices is a reduced schema of the MTD as
> only a few property are supported for it. (reg, label and read-only)
> 
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
>  .../bindings/block/partitions/partition.yaml  | 33 +++++++++++++++++++
>  .../bindings/block/partitions/partitions.yaml | 27 +++++++++++++++
>  .../bindings/mtd/partitions/partition.yaml    | 10 ++----
>  3 files changed, 62 insertions(+), 8 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/block/partitions/partition.yaml
>  create mode 100644 Documentation/devicetree/bindings/block/partitions/partitions.yaml

Partitions are partitions. We don't need them defined in both mtd and 
block. Could perhaps move them to bindings/partitions/, but that's not 
really worth it in my opinion. Just use and add to what's in mtd.

> 
> diff --git a/Documentation/devicetree/bindings/block/partitions/partition.yaml b/Documentation/devicetree/bindings/block/partitions/partition.yaml
> new file mode 100644
> index 000000000000..b9b1d8139e56
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/partitions/partition.yaml
> @@ -0,0 +1,33 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/partitions/partition.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Partition
> +
> +description: |

Don't need '|' if no formatting.

> +  This binding describes a single flash partition. Each partition must have its
> +  relative offset and size specified. Depending on partition function extra
> +  properties can be used.
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@...il.com>
> +
> +properties:
> +  reg:
> +    description: partition's offset and size within the flash (in sector
> +      block, 512byte)
> +    maxItems: 1
> +
> +  label:
> +    description: The label / name for this partition.
> +
> +  read-only:
> +    description: This parameter, if present, is a hint that this partition
> +      should only be mounted read-only. This is usually used for flash
> +      partitions containing early-boot firmware images or data which should
> +      not be clobbered.
> +    type: boolean
> +
> +additionalProperties: true
> diff --git a/Documentation/devicetree/bindings/block/partitions/partitions.yaml b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
> new file mode 100644
> index 000000000000..9c161aac364d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/block/partitions/partitions.yaml
> @@ -0,0 +1,27 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/block/partitions/partitions.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Partitions
> +
> +description: |
> +  This binding is generic and describes the content of the partitions container
> +  node.
> +
> +maintainers:
> +  - Christian Marangi <ansuelsmth@...il.com>
> +
> +properties:
> +  '#address-cells':
> +    enum: [1, 2]
> +
> +  '#size-cells':
> +    enum: [1, 2]


Like *all* other 'partitions' nodes, you need a compatible to say what 
kind of partitions you have. It's conceivable that some vendor invented 
their own scheme just like MTD devices.

As I said before, this is just 'fixed-partitions'. If some properties 
aren't supported, that's fine. All the 'align' properties are for 
flashing tools and aren't supported in Linux. 

Rob

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ