From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAD78C48BDF for ; Tue, 22 Jun 2021 13:44:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9381F61289 for ; Tue, 22 Jun 2021 13:44:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9381F61289 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uHZhkizUVE3RPZEgOZ6f0fpyYrwQhW8WYpwFM8M8yiA=; b=jPtuGsL0J7koW2 FTFSY8R0WI4kt9Ducr6RWRXRKRTfJfEWNt3TnEXQHgjHgmm0BrDrkI9FUYJ8m94XOpiVZB/DKWMvN uwzP98Cow3wP7jeRPrd2mOtN9MQrDSfFgP1nHv1vkCg3Gl8Efs+RrhhD50f0NQBVAAgkiVFX7v3Jz olJWSpEwhpJnZ93lO9RDA/B2GtE3MSSz/+6x8UjCAkSWAEoI5/CZEgmCqA5hava3g1nXS3QuLELoF xAEkjyb7GjpQlL/N8ma2JpE1k8K5Hshxr01SHzC1+ShLgvt5JE3rqJoyW0N5EUmr4Ft8k36y4jQR3 6zmZTmRdA/N0HD+maHUg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvgh3-007LrH-SG; Tue, 22 Jun 2021 13:43:57 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lvggz-007Loc-NO; Tue, 22 Jun 2021 13:43:55 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9AEB61374; Tue, 22 Jun 2021 13:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624369432; bh=NqFXh1RzaIB7T3yUivBhV+3jLDLAyj/zzCtWY0JA0SQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=n2C4l95B/w+7fm3Hy/W1ls3BjWTgUnPkeMWPcJwuHNhjALViq36NSNRvf1J+UxXwT W1of8Zg2OiipKGz+JaQJVEN0Rymz9BqpYAiOBzmrtdT5/mgiDbEVBsHlr3gDk+TOBO Fe7qpiKq+UgUir5JlR9fsJDRZtySIEJhB36NWX9yf5t0mO64+Z1mYCq7ew8ZAwg0KI F5hwQr8sPPDgEGs9UTcylTzkdsRMaQyTccf/acpKJhxDJxKtULLFNQYEsUOGj4MJxK B3a0hJqzs9FjH4X1uUrkMDUidT5NSByby5xfUTkfYV6nW2261SSjbz6fXsdgEAv5QU qCbHec6qB4IfA== Received: by mail-ed1-f52.google.com with SMTP id i5so6299002eds.1; Tue, 22 Jun 2021 06:43:52 -0700 (PDT) X-Gm-Message-State: AOAM530KlwrFzUR3y+1zl5WIPXxa6QYHXD90dig6MSvC6QZO4Zm2lbvL KOGAAmejAe6uPNBpNlscu2UtsIK/sZ981UbMHw== X-Google-Smtp-Source: ABdhPJzR0Ub3ZgSNkr3MEhjSHq6x9DynzmvMX7quMzOS1boijoDJs7nsAsYPAJuJ3rupM/aSXMVZuLXS4ayPZR+vCGA= X-Received: by 2002:a05:6402:ca2:: with SMTP id cn2mr2897976edb.62.1624369431373; Tue, 22 Jun 2021 06:43:51 -0700 (PDT) MIME-Version: 1.0 References: <20210615191543.1043414-1-robh@kernel.org> In-Reply-To: From: Rob Herring Date: Tue, 22 Jun 2021 07:43:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: Drop redundant minItems/maxItems To: Geert Uytterhoeven Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , "open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)" , linux-clk , Linux ARM , Linux Crypto Mailing List , DRI Development , dmaengine , Linux I2C , "open list:IIO SUBSYSTEM AND DRIVERS" , ALSA Development Mailing List , Linux IOMMU , Linux Media Mailing List , Linux MMC List , netdev , linux-can@vger.kernel.org, linux-pci , linux-phy@lists.infradead.org, "open list:GPIO SUBSYSTEM" , Linux PWM List , "open list:REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM" , linux-riscv , "open list:REAL TIME CLOCK (RTC) SUBSYSTEM" , "open list:SERIAL DRIVERS" , linux-spi , Linux PM list , USB list , Linux Watchdog Mailing List , Jens Axboe , Stephen Boyd , Herbert Xu , "David S. Miller" , David Airlie , Daniel Vetter , Vinod Koul , Bartosz Golaszewski , Kamal Dasu , Jonathan Cameron , Lars-Peter Clausen , Thomas Gleixner , Marc Zyngier , Joerg Roedel , Jassi Brar , Mauro Carvalho Chehab , Krzysztof Kozlowski , Ulf Hansson , Jakub Kicinski , Wolfgang Grandegger , Marc Kleine-Budde , Andrew Lunn , Vivien Didelot , Vladimir Oltean , Bjorn Helgaas , Kishon Vijay Abraham I , Linus Walleij , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Lee Jones , Ohad Ben-Cohen , Mathieu Poirier , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alessandro Zummo , Alexandre Belloni , Greg Kroah-Hartman , Mark Brown , Zhang Rui , Daniel Lezcano , Wim Van Sebroeck , Guenter Roeck X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210622_064353_884368_2A6664F2 X-CRM114-Status: GOOD ( 30.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Jun 22, 2021 at 2:17 AM Geert Uytterhoeven wrote: > > Hi Rob, > > On Tue, Jun 15, 2021 at 9:16 PM Rob Herring wrote: > > If a property has an 'items' list, then a 'minItems' or 'maxItems' with the > > same size as the list is redundant and can be dropped. Note that is DT > > schema specific behavior and not standard json-schema behavior. The tooling > > will fixup the final schema adding any unspecified minItems/maxItems. > > > > This condition is partially checked with the meta-schema already, but > > only if both 'minItems' and 'maxItems' are equal to the 'items' length. > > An improved meta-schema is pending. > > > Signed-off-by: Rob Herring > > > --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > > +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > > @@ -46,7 +46,6 @@ properties: > > > > clocks: > > minItems: 3 > > - maxItems: 5 > > items: > > - description: GMAC main clock > > - description: MAC TX clock > > While resolving the conflict with commit fea99822914039c6 > ("dt-bindings: net: document ptp_ref clk in dwmac") in soc/for-next, > I noticed the following construct for clock-names: > > clock-names: > minItems: 3 > maxItems: 6 > contains: > enum: > - stmmaceth > - mac-clk-tx > - mac-clk-rx > - ethstp > - eth-ck > - ptp_ref > > Should this use items instead of enum, and drop maxItems, or is this > a valid construct to support specifying the clocks in random order? > If the latter, it does mean that the order of clock-names may not > match the order of the clock descriptions. 'contains' is true if one or more entries match the strings. So it is really saying one of these is required. That's not really much of a constraint. There's 'minContains' and 'maxContains' in newer json-schema versions (not yet supported) that could add some constraints if there has to be at least N entries from contains. An 'items' schema (as opposed to a list) would say all items have to match one of the strings. I'm sure that's too strict. TLDR: clocks for this binding are a mess and the above is probably all we can do here. Rob _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv