Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp834837rwb; Mon, 26 Sep 2022 06:30:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5KSNveQujsb4tidrAT09LyjLCd7lWnBbzQrHckUUjLHiV6OolksEPFCtYkJnulhzjavUGR X-Received: by 2002:aa7:cc13:0:b0:453:52dc:1bbf with SMTP id q19-20020aa7cc13000000b0045352dc1bbfmr22530170edt.30.1664199028515; Mon, 26 Sep 2022 06:30:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664199028; cv=none; d=google.com; s=arc-20160816; b=Vovdfte2naF+cH2jKIK1CwXjyI+r3O7vry6K/WBij2QYRMGgJEGr9WYvQs6RuqqEMH FzKiuaQ/aB+ky/gJB5qsQXUyNPo3FqDzPzZiRlG5yJXRqgHqP584b7pqYIUtAvnpfh0U 7hLK3y1QXh6C7PXsLyOSTqb1fHO0i0ORP4A9mnPz3Swswd7Mrvwzd2nWVfk3kGC6776w QmkOQU7nJPppBvXNAL4EL/h0CY7R5KoCmLfb2ViOjBkR3gNonRPJezAwi3nwbjGwcjkU RJJ5Vd5tM/W/k12KGPq551loN7tChRHK9/OHlQdwdiHU2BrEqcmUaJ3KAZkBGyn4a9X8 +9WA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Jl6cjv+drkaJXciTp9WRqX81dzsBqWQTjT/Pmz2Ud+k=; b=HoLe4f65Yml0HNUw0eXhjudFtGYrRMANcNftHsrlyREqd7QYFJaQf32qhAhOXf+7WB 0n8XcpxxNCS297xRwCWMiAAXhSsG/ify2704Y/+psaYwRCVIDO97eFn3tr/Q0d2o3Gbw P+4GcB897hEsG+kkmJZA8UFWZELUTt1NmU4l3V/2qW032XQq/0iL5jZffS91RR5CyCnS 5zBzWkT9MgH5jXxMIY0BQgEUf99yqjT09Ls7raeW0IEiWCisdHCpE4kSruwGiSFfFdv6 jW6GuOc3XRibdHvtqLQz/uBB1TJtT/0P7Bti4Wq2n8Ai4xegULcl+chQBMGJ1jiHiiL+ 4EOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BzAkBsi7; 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 j11-20020a508a8b000000b004539a0fc32dsi15270659edj.317.2022.09.26.06.30.02; Mon, 26 Sep 2022 06:30:28 -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=BzAkBsi7; 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 S235874AbiIZMhj (ORCPT + 99 others); Mon, 26 Sep 2022 08:37:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235749AbiIZMhL (ORCPT ); Mon, 26 Sep 2022 08:37:11 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94610766F; Mon, 26 Sep 2022 04:14:34 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id s6so10256890lfo.7; Mon, 26 Sep 2022 04:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=Jl6cjv+drkaJXciTp9WRqX81dzsBqWQTjT/Pmz2Ud+k=; b=BzAkBsi7CtYIjezHbmpZx5ZGxpGRZyB9yGeQMV6lVe9HR2svwaxddtPLmOelpPor8G V9Gt2sV7WJYTNEA95h0/cpXwsH9RmVrgtO11FoXn4RiEwSfof9xyrbaYbDf/j9OsU7+d XP0E8SSOuSFSyXBKiUAt/FcFHBku1KEA+iWzUTagsE8o0yUBR8PQll90FWQHeuNUZQLo AD8qZpt4GITl1bT/HX4++H8SVgN6qRlMYCtf/bt5RtMaz8GU2oA4CCekd3Ccd7YDH+xp EHU9+aApQrPakiDLVjGV+8uo7Do92pUUN5PlLXainiGbWu5/EVkCuL1sMl+5MxXg38LS Qlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=Jl6cjv+drkaJXciTp9WRqX81dzsBqWQTjT/Pmz2Ud+k=; b=pthB71/JOtJttEo9dUd8Qewe9tyDuLi/f9z13ilkbbG+44cFqXtTBbdzxC2eBE9IFD N1vGK0nP0V9pTZCd69pJdjz4qTToJcZe8Nu81s94ffIhmhIzlb2Gv586LEUKAh7ZJgDg AGr4ksmW3znx4xUIjBf+wb701qonMx/S3Z5c3TieUI64nLcyZ7Am6IzdA+BVtBz8QvLz bsbqIuGCjbwobluuEU4d4EtF0/BKhYq65f53QPb8pl17Z0OeG8aqefdfPp+W+bUICH7H 8GEZ73xBTyWwMLNl7Y6+iEkpzFd2+BJj/tqUeYh5MFlI4WJmGrdb02ONRLg/cpnMuC5s n/mg== X-Gm-Message-State: ACrzQf06Yox+/smVqICE7bjMZKAy8ULryKDvL2oW6efGuQGTevvU54uo J2/ICvS9s5ahpS4Fe98QczBtnZ+r0Lssag== X-Received: by 2002:a05:651c:1591:b0:261:c388:aa58 with SMTP id h17-20020a05651c159100b00261c388aa58mr7587463ljq.277.1664189775575; Mon, 26 Sep 2022 03:56:15 -0700 (PDT) Received: from mobilestation (ip1.ibrae.ac.ru. [91.238.191.1]) by smtp.gmail.com with ESMTPSA id p26-20020a056512313a00b00490b5f09973sm2505226lfd.92.2022.09.26.03.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Sep 2022 03:56:15 -0700 (PDT) Date: Mon, 26 Sep 2022 13:56:11 +0300 From: Serge Semin To: Rob Herring 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 Subject: Re: [PATCH v2 03/15] dt-bindings: memory: snps: Convert the schema to being generic Message-ID: <20220926105611.32od2rjlvybmzmut@mobilestation> References: <20220910195659.11843-1-Sergey.Semin@baikalelectronics.ru> <20220910195659.11843-4-Sergey.Semin@baikalelectronics.ru> <20220912143219.GC1170702-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220912143219.GC1170702-robh@kernel.org> 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 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 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) 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? 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. -Sergey > > Rob