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=-16.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 3C40DC2B9F4 for ; Tue, 22 Jun 2021 13:43:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16BA561289 for ; Tue, 22 Jun 2021 13:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbhFVNqK (ORCPT ); Tue, 22 Jun 2021 09:46:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:37118 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbhFVNqJ (ORCPT ); Tue, 22 Jun 2021 09:46:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BC2F861353; 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-f48.google.com with SMTP id t3so23726766edc.7; Tue, 22 Jun 2021 06:43:52 -0700 (PDT) X-Gm-Message-State: AOAM530naL8j0CKzvJfrllBmASUFsX2bsI1GjGzC0mAXDpPnd7e/OVpX 4EDZT2wnXe4JGzDS7JIUEAN3Ta5uIGiYDz5J5Q== 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.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