Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2613473iob; Fri, 6 May 2022 06:52:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5FE7PrdCiFozSymaH8oM2/gBgT0Ryte+A2zfMwpgclx8EXxY2dHxrupb0RYE1uy2l4rzC X-Received: by 2002:a05:6402:f25:b0:427:bf59:ad72 with SMTP id i37-20020a0564020f2500b00427bf59ad72mr3526396eda.231.1651845134088; Fri, 06 May 2022 06:52:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651845134; cv=none; d=google.com; s=arc-20160816; b=0i3dEJ0QSxtHOb/MnkHq4RfoAdz9DJzb0/etHfSPCNpnxlRF0lThrVpptbyHedEurN YJzn2nCURXUCiQJY9IHZYOejgRiCgMzCgcRgqHS2MY33NtH/F3ld3VRLTO6PO4HCuDXW qnjAnlANimoITXHSZvP9Yy2+t+8Id3gHeb2qfczX76qKbroi5gPGZSDGNd0tLGC/ILQx 8FdmaUR8y2l6wO6Tdt+H5M5ifFonAeHoR6BY+Gl/+lnVlQmiX7MHzN+tE0qf9B8ci3xC inSBjjv8DSjwKCdjns0L2ArKNka3l5X/Ksdf03p9PGrxzT3uQ/MXY22WiTn+gQEOHyva olHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:subject:cc:to:from:date :message-id:dkim-signature; bh=pRe2tTAP4iLVD9RQ1l2haGJ7VnUp8txM+9KQIOzBu28=; b=CnLT/mb27gZBQvtYsgoMCgdZyx1xzaG38VlFI/PNIlz7AiAtWWBNy6viyttc+E9uOb BsTJg8tt7pWUwVmDFbrK0LtUEF+9BEh8vN8PrXyRNIkMAv1eu0a4jVO5i3iDk3lGP6Up 2x/tY1nz83GXwiXdh69v2of8KJerQU1ExJU0T9q/RySaA7/Gfmzqe0/Fk0pWnTLD5zMi 04hJyNTKUQARomeH+jd2W6tmvSKNABz2Y2+SxroTbKavNGzW/pIHp95oOxasMcVkfu0f qk9o0/wWyccAwVtMyr0k82edATj2RwGAKxhAIOK64SooBfLHLZYZvL1XY8vDm5yUB5zk ThSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jILl5MWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs36-20020a1709072d2400b006f39af9ad2esi5658605ejc.436.2022.05.06.06.51.47; Fri, 06 May 2022 06:52:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jILl5MWm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353781AbiEDU4k (ORCPT + 99 others); Wed, 4 May 2022 16:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357266AbiEDU4e (ORCPT ); Wed, 4 May 2022 16:56:34 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B563515A6; Wed, 4 May 2022 13:52:57 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id j6so5110149ejc.13; Wed, 04 May 2022 13:52:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:from:to:cc:subject:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=pRe2tTAP4iLVD9RQ1l2haGJ7VnUp8txM+9KQIOzBu28=; b=jILl5MWmUcKv0gRrOEGVXQoMprsX6370Dpkgt5Gb6buyuJg/ZvaC2KanQpr95fUdC5 UvKWiCaITL8lsYFF5ONDpgubS/9ThEle+ooWtsY4Fx4Ui6VIfovfQec+SQih7RZsljCq atbMUdd8/iW0Dv4Sobelt7Me5zPNywDn/PB0wLbmDVnG1AggdVP8O9ZVGyB1kM9f7HdN Um9VQRIGzVsKCD6PqVvkByd2VEkmn8bzOVUSLg8HnCJGp0HbxWnQpZP/Lx4ejndyyKDC deU+oM7GjcvGCDZkjbJB5HMlzUMPqryXKCHp9XiJI3cZoWHC1EBzoZ1osAngBZat2lNm lHvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:from:to:cc:subject:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=pRe2tTAP4iLVD9RQ1l2haGJ7VnUp8txM+9KQIOzBu28=; b=WMC4Dm/xwpmtncCCbHcUwwYMfN9fOL4K35dvMqeMTMJIVZGIn5otPRR8gFNiaJSAKB eL8KjzloRYS0osL+5B1ryfZXoH7Io8n/J4daGy9PixQ7fNF/WEod7Wh0bHld/PTLAVW7 8LGm2A7bzd+FW8PaKAeIkV4AaJLT81cJlkKYtEoZWTtdxR++JZl/kGnH2PaAGCD8iw60 7M7V2kftqxx6aYmaQRD7YWlyXCoey/MN4jOFd5ZkCTr0r0FFAjwoIV+QDsnyCQ+eTLNk xgwD7fKlMuEcyV2yuneGt3MtJLGGajiIwPK5OQXROT2zqvtA4cTIncoq1tTfj2LgE/Yu cESg== X-Gm-Message-State: AOAM533Sm7vhU6V4KQOu/7x5bBxgwqHcGDfcIk5ojNe1D66OWX6PVOrY IE+BC0fqDkwNNRokOheMviw= X-Received: by 2002:a17:907:7247:b0:6f4:ed49:cd3f with SMTP id ds7-20020a170907724700b006f4ed49cd3fmr418987ejc.172.1651697575554; Wed, 04 May 2022 13:52:55 -0700 (PDT) Received: from Ansuel-xps. (93-42-70-190.ip85.fastwebnet.it. [93.42.70.190]) by smtp.gmail.com with ESMTPSA id ml13-20020a170906cc0d00b006f3ef214e08sm6052832ejb.110.2022.05.04.13.52.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 May 2022 13:52:55 -0700 (PDT) Message-ID: <6272e7a7.1c69fb81.dae8f.70aa@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 4 May 2022 22:52:53 +0200 From: Ansuel Smith To: =?utf-8?B?UmFmYcWCIE1pxYJlY2tp?= Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Krzysztof Kozlowski , Manivannan Sadhasivam , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH v3 1/2] dt-bindings: mtd: partitions: Document new partition-dynamic nodes References: <20220429124825.21477-1-ansuelsmth@gmail.com> <20220429124825.21477-2-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, WEIRD_QUOTING autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 04, 2022 at 10:39:14PM +0200, Rafał Miłecki wrote: > On 29.04.2022 14:48, Ansuel Smith wrote: > > Document new partition-dynamic nodes 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 node name must be in the form of "partition name"-dynamic. > > If the partition can't be displayed using the node name, it's possible > > to use the label binding that will be used instead of the node name. > > The node name or 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 > > --- > > .../mtd/partitions/partition-dynamic.yaml | 56 +++++++++++++++++++ > > .../mtd/partitions/qcom,smem-part.yaml | 4 ++ > > 2 files changed, 60 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/mtd/partitions/partition-dynamic.yaml > > > > diff --git a/Documentation/devicetree/bindings/mtd/partitions/partition-dynamic.yaml b/Documentation/devicetree/bindings/mtd/partitions/partition-dynamic.yaml > > new file mode 100644 > > index 000000000000..e0efa58e4fac > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/mtd/partitions/partition-dynamic.yaml > > @@ -0,0 +1,56 @@ > > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/mtd/partitions/partition-dynamic.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Dynamic Partition > > I'm not native but that "Dynamic Partition" sounds pretty natural and > I'm wondering if you shouldn't make that binding dynamic-partition.yaml > > Any natives to comment on this? :) > > The naming for the file is used to keep the standard of [parser]-partition.yaml. Agree that we should find a better naming for all of this. > > +description: | > > + This binding describes a single flash partition that is dynamically allocated > > + by a dedicated parser that is not a fixed-partition parser. > > + > > + A dynamic partition require the node ending with the "-dynamic" tag and if the > > + dynamic partition name can't be displayed using the node name, the label > > + properties can be used. The node name or the label have to match the dynamic > > + partition allocated by the parser. > > + > > + These special partition definition can be used to give a dynamic partition > > + an OF node to declare NVMEM cells. An example is declaring the partition > > + label and all the NVMEM cells in it. The parser will detect the correct reg > > + and offset and the NVMEM will register the cells in it based on the data > > + extracted by the parser. > > + > > +maintainers: > > + - Ansuel Smith > > + > > +properties: > > + label: > > + description: The label / name for the partition assigned by the parser at > > + runtime. This is needed for sybsystem like NVMEM to define cells and > > + register with this OF node. > > + > > +additionalProperties: true > > + > > +examples: > > + - | > > + flash { > > + partitions { > > + compatible = "qcom,smem-part"; > > + > > + art-dynamic { > > + compatible = "nvmem-cells"; > > + #address-cells = <1>; > > + #size-cells = <1>; > > + label = "0:art"; > > + > > + macaddr_art_0: macaddr@0 { > > + reg = <0x0 0x6>; > > + }; > > + > > + macaddr_art_6: macaddr@6 { > > + reg = <0x6 0x6>; > > + }; > > + }; > > + }; > > + }; > > I see that we need a property (like "label") for storing partition name > as it may contain characters not allowed in $nodename. > > Is there a reason to play with all that foo-dynamic $nodename then? With > fallback from "label" to extracting foo from *-dynamic pattern? > Honestly the "-dynamic" thing is to correctly handle this ""strange"" Documentation. At times using the pattern caused tons of problems with pattern so I had this bright idea of using the suffix "-dynamic" to cleary differentiate these special partition from fixed one. > Could we just be lazy, keep things simple and require "label" property? > This is problematic to correctly assign a patternProperties to any user or this parser. > Then we could e.g. require $nodename to be pattern ^partition-[0-9a-f]+$ > It's what leds-gpio.yaml does for reference. > Mhhh ok I can totally make this change. My concern is that someone would get confused thinking they are fixed partition declared on top of the parser. But yhea this can also work... It's really a similar implementation of what I already to with dynamic. If you want I can do this change and send a v4. > Example: > > partitions { > compatible = "foo"; > > partition-1 { > label = "bootloader"; > }; > > partition-2 { > label = "0:art"; > }; > }; -- Ansuel