Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1590859rwb; Tue, 27 Sep 2022 15:43:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7e05rudxs7RbIGuV1z8Lo6q095YERvd5q98IOidwV2Bv4grDT6wbpNv+oy7Qi3iq0pegX+ X-Received: by 2002:a17:906:eecb:b0:73c:5bcb:8eb3 with SMTP id wu11-20020a170906eecb00b0073c5bcb8eb3mr24729642ejb.284.1664318616191; Tue, 27 Sep 2022 15:43:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664318616; cv=none; d=google.com; s=arc-20160816; b=U7lMBbqXBaYnO1L/vmhxSc+bETPdz/DK8nyQCAlWwvAs8rSWH3gBsDi+nGdqCikS7L 4JWRLCQO6pvGv5PB+TeEzetpCCOvSeJpyLzbRZV8oRnKSwyl8bKJyBuIXvYDLfoH3KRd GjY7sVXOXEY3vHS1x3auzMwBsihQ73kPE8lPBe52NVCTK2eiNb6NE/Quo5biRb++aPko xUYES8GuB8mkiDhS1Zc6HqFeq56vbbY5eDSTU4bjPYZ0G/NDSbBRwtXPVNWaOsA+LOrw pMkcTsz3IR2hZeTvxQZ1tW7scKezj9d1ppamduOInD7L91G9GZ4aU0I/VF2tPyoqNGn8 2YXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=jfPVR2VxPtvGjIe/ymvpKhWraB577dDrlxVUSeG0tz0=; b=F2K8U/mpNvjlh33cMvy/Tp3Y/DZ6tcwuhaX659uuTeB0Ovvhxw1CoHik36okgBvZr6 1WMHSVgiSEfWvavSwaCqX2rXLUnESxs0k/60hMB3QJC91t1q+mrgN6KSgHghm1p2ru4j O6ybfxAgQoVaM2fWVSHQ3+mNhJFaFUln+2uJLKNgsYxAVy5AILohte7DARtJnIRRHTgd ZhLtYq1UV6Fap2j+/qe75pYUl3WPm4Zqn6cUoOsl8JfZt1hg1Vq63x2dRhVxFmj3SkIg jFT4d173IFbLVhWe7ULEDY1IrUHQT5Z4PAv818ruuWhlChi5Y51kG+JYLlhtJqweWicT ilng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RiuAoDJG; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v5-20020a056402348500b004477568d7a4si3873429edc.215.2022.09.27.15.43.07; Tue, 27 Sep 2022 15:43:36 -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=@kernel.org header.s=k20201202 header.b=RiuAoDJG; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232203AbiI0WC6 (ORCPT + 99 others); Tue, 27 Sep 2022 18:02:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232138AbiI0WC4 (ORCPT ); Tue, 27 Sep 2022 18:02:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7D4516F9F3; Tue, 27 Sep 2022 15:02:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 619BEB81DC8; Tue, 27 Sep 2022 22:02:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22730C43470; Tue, 27 Sep 2022 22:02:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664316173; bh=UuJ3kwUDiAb68knmsWu43hQq5qs0xTpLQ/TXrsq5uX0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RiuAoDJGaBBKykecBWqY8FUAQ5ELAbsXNXMLfgxjvHOGetEgGXeI97iFzQfmz3g8L 34k9DcH5N3+vepsgL1XUYzaCQXIs4t1Znbs2u09hQHy455Jn00sbMOn0L/ZErnT9Di Kue4uUMUxB1+WTCThlQPqRL1BgAU99tWLX5yAUbVJFqVT81SAeoWyW9BLxDBbECuh4 Tsxr5Tz0ZPXeUtHVauH1prCkl8GK1LO0c1hNpzAT6aYtyiJ1UfgRuSzaGwq62WV9Yh zonGu2Sli1KkuGwIUzK367LNpEDPVUTZDn/58v9dfiDxeWNarkegsB78pkyD6ZXcJ4 pXU/RNbhfmhWw== Received: by mail-vs1-f46.google.com with SMTP id j7so10995994vsr.13; Tue, 27 Sep 2022 15:02:53 -0700 (PDT) X-Gm-Message-State: ACrzQf0Sfk0RJ2xwT7Wag3bQY4Wh4jCkK4LGlHyA8tggeLbCaXJOpSW6 hQIszCbzCM8mGSUYdVjqKXSJPwUtlMQb6vEZ1Q== X-Received: by 2002:a67:3c7:0:b0:39b:45c2:6875 with SMTP id 190-20020a6703c7000000b0039b45c26875mr11835103vsd.6.1664316171954; Tue, 27 Sep 2022 15:02:51 -0700 (PDT) MIME-Version: 1.0 References: <20220910195659.11843-1-Sergey.Semin@baikalelectronics.ru> <20220910195659.11843-4-Sergey.Semin@baikalelectronics.ru> <20220912143219.GC1170702-robh@kernel.org> <20220926105611.32od2rjlvybmzmut@mobilestation> In-Reply-To: <20220926105611.32od2rjlvybmzmut@mobilestation> From: Rob Herring Date: Tue, 27 Sep 2022 17:02:40 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 03/15] dt-bindings: memory: snps: Convert the schema to being generic To: Serge Semin Cc: Serge Semin , Krzysztof Kozlowski , Michal Simek , Borislav Petkov , Mauro Carvalho Chehab , Tony Luck , Krzysztof Kozlowski , Manish Narani , Alexey Malahov , Michail Ivanov , Pavel Parkhomenko , Punnaiah Choudary Kalluri , Dinh Nguyen , James Morse , Robert Richter , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Mon, Sep 26, 2022 at 5:56 AM Serge Semin wrote: > > On Mon, Sep 12, 2022 at 09:32:19AM -0500, Rob Herring wrote: > > On Sat, Sep 10, 2022 at 10:56:47PM +0300, Serge Semin wrote: > > > At the current state the DW uMCTL2 DDRC DT-schema can't be used as the > > > common one for all the IP-core-based devices due to the compatible string > > > property constraining the list of the supported device names. In order to > > > fix that we suggest to update the compatible property constraints so one > > > would permit having any value aside with the generic device names. At the > > > same time the generic DT-schema selection must be restricted to the > > > denoted generic devices only so not to permit the generic fallback > > > compatibles. Finally since the generic schema will be referenced from the > > > vendor-specific DT-bindings with possibly non-standard properties defined > > > it must permit having additional properties specified. > > > > > > Signed-off-by: Serge Semin > > > > > > --- > > > > > > Note alternatively we could drop the "additionalProperties" keyword > > > modification since currently there is no actual device available with the > > > properties not listed in the generic DT-schema. > > > > > Normally, this has required 2 schema files. However, I think you can > > do something like this: > > > > if: > > compatible: > > enum: > > - snps,ddrc-3.80a > > - snps,dw-umctl2-ddrc > > - xlnx,zynqmp-ddrc-2.40a > > then: > > unevaluatedProperties: false > > > > > > But please make sure that actually catches undocumented properties > > because unevaluateProperties under 'then' is not something I've tried. > > Oh, I wish this would work! Alas it doesn't. AFAIU the schemas under > the "then" and "else" keywords are considered as separate schemas > and are independently applied to the DT node. As soon as I added the > construction suggested by you the schema evaluation started failing > with error as none of the DT-node properties in the examples are valid: > > < ... /snps,dw-umctl2-ddrc.example.dtb: memory-controller@fd070000: > < Unevaluated properties are not allowed ('compatible', 'reg', interrupts', 'interrupt-names', '$nodename' were unexpected) > > < ... /snps,dw-umctl2-ddrc.example.dtb: memory-controller@3d400000: > < Unevaluated properties are not allowed ('compatible', 'reg', 'interrupts', 'interrupt-names', 'clocks', 'clock-names', '$nodename' were unexpected) Indeed. While unevaluatedProperties takes if/then/else into account, flipping it around doesn't. > Any suggestion of how this could be fixed? Perhaps updating the > dtschema tool anyhow? (I failed to find a quick-fix for it) Creating > an additional separate schema with the common properties seems a bit > overkill in this case. On the other hand is there a decent > alternative? I don't think there is any other fix. > What about accepting what I suggested in this patch? It does permit > additional properties, but we won't need to have a separate schema > with just several common properties. No. You can't have it both ways. Either it is a common schema or a specific device schema. Rob