Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1475428pxu; Thu, 8 Oct 2020 12:23:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjrxv40mrRTCjxHJNdK9YZDAREr8ZQQq8SZubdBbtTo6WZMUXxEk6W3FEaeKto6f/rxGwT X-Received: by 2002:aa7:c586:: with SMTP id g6mr7203304edq.343.1602185004439; Thu, 08 Oct 2020 12:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602185004; cv=none; d=google.com; s=arc-20160816; b=Z50KZOaCPqSjekT7VXwZIYOKEa3scaRftoDCY7Nh8AvnZ3dkqCL2rjrOCCxDZDdFo9 Ratw3R3PSmLRDwDza2DK8mF7uHy/nKGTUgi4UX/bISGLIJSLo3vNGMIdXJNKTcokeccX JqbKjfThYyUbSpXYnhmDQBInA382jMtxGQKdPlU5i8rr5ZWd1ike63jea5t83NgXHuDV KP6UXQTx67DfyaY6hdjEcMc+hUM78Onc+VCIjQggjeYCvFoBr16bVIX5JcLXe/e7J2yb X81ZSO9+Bj6NutSlVuqmPYHafbO1vu3IvmCEPlC5FqL3my+kSIUHr4s4U5V5BBChhTb+ 9qrA== 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=WL3YsCOIxJr8/OTMLc065ycUP5jbqqjAW0d34J6P23I=; b=BcXPjIvuHdHKh6HH3PnWO9OomEvnAy7/6KC1PSfuT1/l4jBlG61VYxBgeTMzOurYsI VT7yO1KINARXE9eDBn00/PjEcxePlXX+JFhwnS6DaBTmntObAgBvxWOUtQFjNBRp0xRK zw8DMQo+yErY+6Uc6AA5jck+wEMyFdUpMAYd/QbbtTT3UyUoB/EQHKUrDTz4uZeMlK+2 bVfK95YUf4sPXGq9lkAtBL5ddIXfVxznzePFypoD2HwwqaY1s8rBarSoPSLDPbi0QFuf FMD2IJr7cDxBUugy0IFNrwA3yOyKIt8H92EFgm4chnfLanUSjSbqJ6/PKiBR0uwE8QgU zqOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rESrq1Po; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v27si4468171ejq.250.2020.10.08.12.23.01; Thu, 08 Oct 2020 12:23:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rESrq1Po; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729756AbgJHTQA (ORCPT + 99 others); Thu, 8 Oct 2020 15:16:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:58668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726469AbgJHTP7 (ORCPT ); Thu, 8 Oct 2020 15:15:59 -0400 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5397121789; Thu, 8 Oct 2020 19:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602184558; bh=VG9NJtGD0MJxDwq5ZtXgpvCKEMD4VJh0wRib10rKuNY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rESrq1PokkafTsfbUWJb7IMjDXZ0uIPoXf0bU1kU/SxPRmf3Mx+4vdeKcKwpA26kP CeGBBUnvCaGWf1s+jlMczL3iVZx4vVY0XtWmgafwj84ZMNs9nOI6nQ22/UnCj11kYP WhEhzD2ura/vORCbHsVuzrkuJi7jkWm64Rme6TA0= Received: by mail-oi1-f171.google.com with SMTP id 16so7473623oix.9; Thu, 08 Oct 2020 12:15:58 -0700 (PDT) X-Gm-Message-State: AOAM531qXa1MfEskESYa+XOYo3FVjpRgNtilsngBwnbjmE8zPg6tyacs T67VVdrrrRfg1YHDB+hRAfg6rU3TT37KBHOC/A== X-Received: by 2002:aca:4c52:: with SMTP id z79mr202300oia.147.1602184557422; Thu, 08 Oct 2020 12:15:57 -0700 (PDT) MIME-Version: 1.0 References: <20200930091412.8020-1-peter.ujfalusi@ti.com> <20200930091412.8020-10-peter.ujfalusi@ti.com> <20201006192909.GA2679155@bogus> <20201007154635.GA273523@bogus> In-Reply-To: From: Rob Herring Date: Thu, 8 Oct 2020 14:15:45 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/18] dt-bindings: dma: ti: Add document for K3 BCDMA To: Peter Ujfalusi Cc: Vinod , Nishanth Menon , Santosh Shilimkar , Vignesh R , Dan Williams , Tero Kristo , Lokesh Vutla , linux-arm-kernel , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, "open list:DMA GENERIC OFFLOAD ENGINE SUBSYSTEM" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 8, 2020 at 3:40 AM Peter Ujfalusi wrote: > > > > On 07/10/2020 18.46, Rob Herring wrote: > > On Wed, Oct 07, 2020 at 12:09:06PM +0300, Peter Ujfalusi wrote: > >> > >> > >> On 06/10/2020 22.29, Rob Herring wrote: > >>> On Wed, Sep 30, 2020 at 12:14:03PM +0300, Peter Ujfalusi wrote: > >>>> New binding document for > >>>> Texas Instruments K3 Block Copy DMA (BCDMA). > >>>> > >>>> BCDMA is introduced as part of AM64. > >>>> > >> > >> ... > >> > >>> > >>>> + ti,sci: > >>>> + description: phandle to TI-SCI compatible System controller node > >>>> + allOf: > >>>> + - $ref: /schemas/types.yaml#/definitions/phandle > >>>> + > >>>> + ti,sci-dev-id: > >>>> + description: TI-SCI device id of BCDMA > >>>> + allOf: > >>>> + - $ref: /schemas/types.yaml#/definitions/uint32 > >>> > >>> We have a common definition for these. > >> > >> Yes, in arm/keystone/ti,k3-sci-common.yaml, but I could not get to use > >> that as reference. > >> > >> I can not list it under the topmost allOf and drop the ti,sci and > >> ti,sci-dev-id like this: > >> > >> allOf: > >> - $ref: /schemas/dma/dma-controller.yaml# > >> - $ref: /schemas/arm/keystone/ti,k3-sci-common.yaml# > >> > >> It results: > >> CHKDT Documentation/devicetree/bindings/processed-schema-examples.json > >> DTEX Documentation/devicetree/bindings/dma/ti/k3-bcdma.example.dts > >> SCHEMA Documentation/devicetree/bindings/processed-schema-examples.json > >> DTC Documentation/devicetree/bindings/dma/ti/k3-bcdma.example.dt.yaml > >> CHECK Documentation/devicetree/bindings/dma/ti/k3-bcdma.example.dt.yaml > >> Documentation/devicetree/bindings/dma/ti/k3-bcdma.example.dt.yaml: > >> dma-controller@485c0100: 'ti,sci', 'ti,sci-dev-id' do not match any of > >> the regexes: 'pinctrl-[0-9]+' > >> From schema: Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml > >> > >> If I remove the "additionalProperties: false" from the schema file, then > >> it compiles fine. > > > > Yeah, you have to do 'unevaluatedProperties: false' which doesn't > > actually do anything yet, but can 'see' into $ref's. > > I see, but even if I add the unevaluatedProperties: false I will have > the same error as long as I have additionalProperties: false Yes. I meant unevaluatedProperties instead of additionalProperties. > If I remove the additionalProperties then it makes no difference if I > have the unevaluatedProperties: false or I don't. Not yet, but it will soon. Once I have the tree in a consistent state in 5.10-rc1, there will be a meta-schema to check all this (which is one of those must always be present). Though, as of now 'unevaluatedProperties' doesn't do anything because the underlying json-schema tool doesn't yet support it. > >>>> + ti,sci-rm-range-bchan: > >>>> + description: | > >>>> + Array of BCDMA block-copy channel resource subtypes for resource > >>>> + allocation for this host > >>>> + allOf: > >>>> + - $ref: /schemas/types.yaml#/definitions/uint32-array > >>>> + minItems: 1 > >>>> + # Should be enough > >>>> + maxItems: 255 > >>> > >>> Are there constraints for the individual elements? > >> > >> In practice the subtype ID is 6bits number. > >> Should I add limits to individual elements? > > > > Yes: > > > > items: > > maximum: 0x3f > > Right, I can just omit the minimum. > > It would be nice if I could use definitions for these ranges to avoid > duplicated lines by adding > > definitions: > ti,rm-range: > $ref: /schemas/types.yaml#/definitions/uint32-array > minItems: 1 > # Should be enough > maxItems: 255 > items: > minimum: 0 > maximum: 0x3f > > to schemas/arm/keystone/ti,k3-sci-common.yaml > > and only have: > > ti,sci-rm-range-bchan: > $ref: > /schemas/arm/keystone/ti,k3-sci-common.yaml#/definitions/ti,rm-range > description: | > Array of BCDMA block-copy channel resource subtypes for resource > allocation for this host Just do: patternProperties: "^ti,sci-rm-range-[btr]chan$": ... If this is common for other bindings, then you can put it in ti,k3-sci-common.yaml. > but it results: > Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml: > properties:ti,sci-rm-range-bchan: {'$ref': > '/schemas/arm/keystone/ti,k3-sci-common.yaml#/definitions/ti,rm-range', > 'description': 'Array of BCDMA block-copy channel resource subtypes for > resource\nallocation for this host\n'} is not valid under any of the > given schemas (Possible causes of the failure): > Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml: > properties:ti,sci-rm-range-bchan: 'not' is a required property > Documentation/devicetree/bindings/dma/ti/k3-bcdma.yaml: > properties:ti,sci-rm-range-bchan:$ref: > '/schemas/arm/keystone/ti,k3-sci-common.yaml#/definitions/ti,rm-range' > does not match 'types.yaml#[/]{0,1}definitions/.*' We probably should allow for using 'definitions' which is pretty common json-schema practice, but don't primarily in order to keep folks within the lines. Things are optimized for not knowing json-schema and trying to minimize errors I have to check for. Supporting it would complicate the meta-schema and the tools' fixup code. So far, the need for it has been pretty infrequent. Rob