Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp360564rwb; Wed, 28 Sep 2022 03:52:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41oEtCj1o3AOa9fn/2vni5ZNG1fPVRwbm1w95keM1jlYOH64jNGOFkB4nti1h/trE6cd5C X-Received: by 2002:a05:6402:5212:b0:451:6301:593e with SMTP id s18-20020a056402521200b004516301593emr32559435edd.119.1664362340368; Wed, 28 Sep 2022 03:52:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664362340; cv=none; d=google.com; s=arc-20160816; b=MnVYjtR7x8eDO8aUWHHd1lrOqm1QuPwDRkWAYMDpml+z9YSc4hJ2PRvkuPuzAH27xB FPz2MzcrfaQX14QdBFnCwXxdOEhhsfmJXbgDzUY7cNbkRtLQuMBwMPvwFBoNmZ+gFC3e KcchW0ROzri39OUqWT8xlBG+FxB0mPS5H9W1eeLBxxvz6O2L/KHf/w0wAXpbSSCvf+UJ KVDe1aoP8qFTrV0Cv+k4PVJhR9fWqU1L7rkbaD/xXveVweRjMO0C7ZxAg4AqNXl+ch0E e9xwSutmFvfsXalJAoqaaAkDX80hOpSRXtZGkLhW2VWs/HsWPz6SiZS1IH625dTRjQd+ v9Gw== 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=EdZBNk8VJDVppuaYhVl5jrx/YbPGgB0lTI+ahlH9Qm4=; b=lRnhlrIAU7vkr2MoVN9xhttNAdicSnzImgdyKQ9ex6jDIXfcf6CQUEbEaxEu3RfxLS cxibHxCtCh58z8Wpp3uP0vGx/g8fHreSadhgwNaQvQd47TIn0prK0qX4+Q1mbB/X8MhP DBMUOH/pN+1DwQlqBIF2d1iDzRzgI5cmTs5vjjB9hL5nGSBWk64aCTRBT3hA2cap7iQq NQrTT69fkDUcs/cNgT2Hl7vwyDWEwp5GapMVvUmP/vPRWnNa0IGXdMDbQI5u7N0XgOHg kuS1w1E7+M7jfM8PdoJGoVUuB/l6N92U+tH5qwhH4VaXOMqEth6rzT47f9kvmTo8xOfn m4Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="TsL/jgEq"; 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 hz6-20020a1709072ce600b007803e36636esi4341995ejc.106.2022.09.28.03.51.53; Wed, 28 Sep 2022 03:52:20 -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="TsL/jgEq"; 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 S233632AbiI1KkC (ORCPT + 99 others); Wed, 28 Sep 2022 06:40:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233557AbiI1Kjy (ORCPT ); Wed, 28 Sep 2022 06:39:54 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC15438A8; Wed, 28 Sep 2022 03:39:43 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id a3so19677179lfk.9; Wed, 28 Sep 2022 03:39:43 -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=EdZBNk8VJDVppuaYhVl5jrx/YbPGgB0lTI+ahlH9Qm4=; b=TsL/jgEqOMG51pH+mCwGq5qkv/ihHEyMrCB8XMUy5ZiwVPMYUxR/KfMriUda/LxhvB bogARgoXRdxa6Vptk28tGQpOXBRiIgd8DDuRp4JJY+FlimVvAqXvv2FwdEivOvouAIxH LeLBPFe1GCLlcw3+bjmquS3YHu1qXfJxLDI3/zncbETLW8NQr1wutIOiD1i4JmpVknmn UIyHccFDAk3GLW5hbIpk6I3EGza9FioU6fSOmKt6zCjp28tYcESROk3K4pQjq9xtpo80 j6o5K/FxlH+8Ev7Oo+Q+DLck8osl6rrScwiEF2x0ogJiEGx8OISDvpgldDzv3RKa+QEl Uwvw== 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=EdZBNk8VJDVppuaYhVl5jrx/YbPGgB0lTI+ahlH9Qm4=; b=O5GR1iS/fRwP56GgMien0VX/mByUYJz9Gmc6HnMG//TnmpDdCWWDE2yeHdWMdqrdjG oUNpn592TQT4+FL0b7txDqNnHCcOicwwYNje3KWiMnkHe9dTiOEX7S6xORWOQODqisUT xcbtnTXkqzRAlJwYY+DqG6LO+dtoon2LjDnKpMt5MhUlpCqdHqRLzZxh0hakFle2Flh0 6V8VyuXF3N3kBUGLY0aPWKn1chazxYDT3wA88e1KEA2Ly2AtVzSjNtS3tc3GyIwEUHpQ 0FpLJhbl+KzYnfqGIZ3taeFPqRmMBsNiyMjOirZ2Vq4OwMivEmFB/bAQUKFNLqDU5RjB UXkQ== X-Gm-Message-State: ACrzQf2IKCnzEzccGkF5H8iHtwfNinWAt0NJPyu3L2pvbSHQY9XaBubM 6iyxSwYxE/TCZqNlCprxde4= X-Received: by 2002:a05:6512:1325:b0:4a1:d80e:1cd5 with SMTP id x37-20020a056512132500b004a1d80e1cd5mr5458610lfu.497.1664361581974; Wed, 28 Sep 2022 03:39:41 -0700 (PDT) Received: from mobilestation ([95.79.140.178]) by smtp.gmail.com with ESMTPSA id s18-20020a056512203200b00498fc3d4cfdsm436015lfs.189.2022.09.28.03.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Sep 2022 03:39:41 -0700 (PDT) Date: Wed, 28 Sep 2022 13:39:38 +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: <20220928103938.nx44vprs6npk2eyp@mobilestation> References: <20220910195659.11843-1-Sergey.Semin@baikalelectronics.ru> <20220910195659.11843-4-Sergey.Semin@baikalelectronics.ru> <20220912143219.GC1170702-robh@kernel.org> <20220926105611.32od2rjlvybmzmut@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 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 Tue, Sep 27, 2022 at 05:02:40PM -0500, Rob Herring wrote: > 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. Sigh... I see. Will fix it in the next patchset round. -Sergey > > Rob