Message ID | 20221114104222.36329-2-konrad.dybcio@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2074764wru; Mon, 14 Nov 2022 02:43:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wJpEFw5iKpqKzhxdYOADIqkNzpkQgy3EvEqMYoGYDkvnC0cAkuXfUds9a0LdIHno4s0kM X-Received: by 2002:a17:907:c00b:b0:7ad:69eb:923b with SMTP id ss11-20020a170907c00b00b007ad69eb923bmr10195807ejc.19.1668422593605; Mon, 14 Nov 2022 02:43:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422593; cv=none; d=google.com; s=arc-20160816; b=gdKJvZ2dqjdBmCuUKzUVZQ8yX5ygpYCDsM+1x+Gm42YX7iAtmuCE2L3qEACBmUZ7CL HUEWwBDQ/NpHolBcp/1zJK25ETppumu+CEDWGFfSH/8dNZ8+e/iX2Yc9QtzBVyi/1niW rgSvycN7NvZQo0DjUlVU1osdD+CCoFm8rnlJ1oUPnWe0GatGesRSeNQj0jInyy9vLij7 e5aqezcCCaQOngElNvqOU7pl/1OXihtJDJfT8yTS8mv8yEM1HF3MOUkCNc52YCaKpzxL 1y8pQlfNmEh1G0AnwEEFntzBClKecSFsKtuchIUnpforl6lAPwzEqJreA9xkUQ+Md1SP cmVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zDzwDb0dnKoTPgCy4RBfiMpDFetmXY9OEGk9SR/WSLY=; b=ftjd//XjU0wDWKzAh3izoy6XiEzzm9GutRO5F+zsjeyWdNPxS2FRFQ8ohFuzzK+Qoa xuG0EG+CzYnQSnw1L/5xz6rqfU2fihO622kPmzA8HMcWR11iJWstjYLGWCcS2X1SJYfC F0G+/CibBVunkY7zlhD3lKzXgq0Gj02BGHSbdJOvBzt33eUG7OVabEN7v/U9dBjYvwK6 /TdOciXUE7k1G4pXWwGnGVUJ+1umNfPrgM90R+iytiiZqzn1uup614hOAGFSA78DXwrl zw79mCXT3zBzOZY5NToUJHdkNPSaNxGidYdAlhk8oj4h9vHPttMs7b3vP9VRC4bBRcVB J1YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FhlApcqD; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020aa7c903000000b00463f8aad371si7969603edt.239.2022.11.14.02.42.49; Mon, 14 Nov 2022 02:43:13 -0800 (PST) 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=@linaro.org header.s=google header.b=FhlApcqD; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236151AbiKNKmk (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Mon, 14 Nov 2022 05:42:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235968AbiKNKmh (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 14 Nov 2022 05:42:37 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F26D1D66F for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 02:42:36 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id l8so12559819ljh.13 for <linux-kernel@vger.kernel.org>; Mon, 14 Nov 2022 02:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zDzwDb0dnKoTPgCy4RBfiMpDFetmXY9OEGk9SR/WSLY=; b=FhlApcqDxCtCoupJ/TIS0Ykf65afLK30ejNB8v2zhMO/08W/KJGjo+jBHJsNqt10pm 1GEqKtYy830ohGlIM91yJZR6N3HiLjwX/ldBqlIKM5vXM3kFSN+2IIvvYOj+qJ87LRfI dzDH0BAB4MOhdYEyvZ3udJabwEej8WLG14Mgf1O8L/LxHKjVqaxAvZpwi12vdDcBIVpu SuIQrLXvLUodif/creo1nAh7wOM3vGtIU/3ALCYbvqgi8SSmbsONxt+v709lJdR5zYEw fxJFr0c9PqfemGYKmEEvkXXlRTEeFlBCxfFC6xv+x98BZlO64aBbZ6833hVafWVYTAYD 0eZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zDzwDb0dnKoTPgCy4RBfiMpDFetmXY9OEGk9SR/WSLY=; b=SJ9LoKbKBw5VWlRs7EKoeikdSVx7DW0fg+Xol6tCh32SfrFRra6JFqOxsFdsF4adSm NYHsEZFG0g17MwXhuRyj/16842E6JUrriEtwZ4RibXwAPadF8e17jOIYkWJz/Wxp4SK6 d4getVcpEZ+knkwkHe7qxL9zem9C+ZwxeGJP2ujOFWhRhoTi6GZQ+PmSRILVotrS5+HJ +XsMC0O+qZaeOxRUlGlx5He+de1dWZXT0lVjqkagQoEygxHKzxUHxtg+72tFeRFJldG+ TzTHp3lolkzuE5YQ91e7OnlwNO8BzCKN6G7qIV1OO5USa2jfpRkekGa1MKS0w+EUa010 /l8Q== X-Gm-Message-State: ANoB5plMsPX0H2TLHoLFNGi6EQzuNPtZP3kRF4+jUhjyYEbggfl/A3QP iJcMW1T/++5o6Xe3nOJnXSTHjQ== X-Received: by 2002:a2e:960d:0:b0:277:4f:bd2a with SMTP id v13-20020a2e960d000000b00277004fbd2amr3622765ljh.341.1668422554455; Mon, 14 Nov 2022 02:42:34 -0800 (PST) Received: from localhost.localdomain ([194.29.137.22]) by smtp.gmail.com with ESMTPSA id bs21-20020a05651c195500b0026c4e922fb2sm1946486ljb.48.2022.11.14.02.42.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 14 Nov 2022 02:42:34 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: patches@linaro.org, Konrad Dybcio <konrad.dybcio@linaro.org>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com>, Joerg Roedel <joro@8bytes.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains Date: Mon, 14 Nov 2022 11:42:14 +0100 Message-Id: <20221114104222.36329-2-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20221114104222.36329-1-konrad.dybcio@linaro.org> References: <20221114104222.36329-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749467889587047799?= X-GMAIL-MSGID: =?utf-8?q?1749467889587047799?= |
Series |
[v2,1/9] dt-bindings: arm-smmu: Allow up to 3 power-domains
|
|
Commit Message
Konrad Dybcio
Nov. 14, 2022, 10:42 a.m. UTC
Some SMMUs require that a vote is held on as much as 3 separate PDs
(hello Qualcomm). Allow it in bindings.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
Changes since v1:
- Add minItems
Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 14/11/2022 11:42, Konrad Dybcio wrote: > Some SMMUs require that a vote is held on as much as 3 separate PDs > (hello Qualcomm). Allow it in bindings. > > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes since v1: > - Add minItems > > Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > index 9066e6df1ba1..82bc696de662 100644 > --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > @@ -159,7 +159,8 @@ properties: > through the TCU's programming interface. > > power-domains: > - maxItems: 1 > + minItems: 0 It cannot be 0. minItems: 1 Anyway you still need to restrict it per variant, as I said in previous version. Best regards, Krzysztof
On 14/11/2022 12:01, Krzysztof Kozlowski wrote: > On 14/11/2022 11:42, Konrad Dybcio wrote: >> Some SMMUs require that a vote is held on as much as 3 separate PDs >> (hello Qualcomm). Allow it in bindings. >> >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- >> Changes since v1: >> - Add minItems >> >> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> index 9066e6df1ba1..82bc696de662 100644 >> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> @@ -159,7 +159,8 @@ properties: >> through the TCU's programming interface. >> >> power-domains: >> - maxItems: 1 >> + minItems: 0 > It cannot be 0. > > minItems: 1 > > Anyway you still need to restrict it per variant, as I said in previous > version. Hm.. I'm not entirely sure what you mean.. Should I add a list of compatibles that are allowed to have 3 power-domains and leave it as it was before in the 'else' case? Konrad > > Best regards, > Krzysztof >
On 14/11/2022 12:17, Konrad Dybcio wrote: > > On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >> On 14/11/2022 11:42, Konrad Dybcio wrote: >>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>> (hello Qualcomm). Allow it in bindings. >>> >>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>> --- >>> Changes since v1: >>> - Add minItems >>> >>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> index 9066e6df1ba1..82bc696de662 100644 >>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> @@ -159,7 +159,8 @@ properties: >>> through the TCU's programming interface. >>> >>> power-domains: >>> - maxItems: 1 >>> + minItems: 0 >> It cannot be 0. >> >> minItems: 1 >> >> Anyway you still need to restrict it per variant, as I said in previous >> version. > > Hm.. I'm not entirely sure what you mean.. Should I add a list of > compatibles Yes and limit it to maxItems: 1 for "else". > that are allowed to have 3 power-domains and leave it as it was before > in the > 'else' case? Best regards, Krzysztof
On Mon, 14 Nov 2022 11:42:14 +0100, Konrad Dybcio wrote: > Some SMMUs require that a vote is held on as much as 3 separate PDs > (hello Qualcomm). Allow it in bindings. > > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > Changes since v1: > - Add minItems > > Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml: properties:power-domains:minItems: 0 is less than the minimum of 1 from schema $id: http://devicetree.org/meta-schemas/keywords.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iommu/arm,smmu.yaml: properties:power-domains: 'anyOf' conditional failed, one must be fixed: 'minItems' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'minItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] 'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] 1 was expected hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 0 is less than the minimum of 1 hint: Arrays must be described with a combination of minItems/maxItems/items hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/power-domain.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/patch/ This check can fail if there are any dependencies. The base for a patch series is generally the most recent rc1. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit.
On 14/11/2022 14:00, Krzysztof Kozlowski wrote: > On 14/11/2022 12:17, Konrad Dybcio wrote: >> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>>> (hello Qualcomm). Allow it in bindings. >>>> >>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>> --- >>>> Changes since v1: >>>> - Add minItems >>>> >>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> index 9066e6df1ba1..82bc696de662 100644 >>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> @@ -159,7 +159,8 @@ properties: >>>> through the TCU's programming interface. >>>> >>>> power-domains: >>>> - maxItems: 1 >>>> + minItems: 0 >>> It cannot be 0. >>> >>> minItems: 1 >>> >>> Anyway you still need to restrict it per variant, as I said in previous >>> version. >> Hm.. I'm not entirely sure what you mean.. Should I add a list of >> compatibles > Yes and limit it to maxItems: 1 for "else". I tried adding: - if: properties: compatible: contains: enum: - qcom,sm6375-smmu-500 then: properties: power-domains: minItems: 3 maxItems: 3 else: properties: power-domains: maxItems: 1 Right under the nvidia reg if-else in the allOf, but dtbs_check throws errors like: /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: iommu@5040000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+' Any clues as to why? Konrad > >> that are allowed to have 3 power-domains and leave it as it was before >> in the >> 'else' case? > Best regards, > Krzysztof >
On 14/11/2022 16:53, Konrad Dybcio wrote: > > On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >> On 14/11/2022 12:17, Konrad Dybcio wrote: >>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>>>> (hello Qualcomm). Allow it in bindings. >>>>> >>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>> --- >>>>> Changes since v1: >>>>> - Add minItems >>>>> >>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>> @@ -159,7 +159,8 @@ properties: >>>>> through the TCU's programming interface. >>>>> >>>>> power-domains: >>>>> - maxItems: 1 >>>>> + minItems: 0 >>>> It cannot be 0. >>>> >>>> minItems: 1 >>>> >>>> Anyway you still need to restrict it per variant, as I said in previous >>>> version. >>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>> compatibles >> Yes and limit it to maxItems: 1 for "else". > > I tried adding: > > > > - if: > properties: > compatible: > contains: > enum: > - qcom,sm6375-smmu-500 > then: > properties: > power-domains: > minItems: 3 > maxItems: 3 > else: > properties: > power-domains: > maxItems: 1 > > > Right under the nvidia reg if-else in the allOf, but dtbs_check throws > errors like: > > > /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: > iommu@5040000: 'power-domains' does not match any of the regexes: > 'pinctrl-[0-9]+' > > > Any clues as to why? I don't know what code do you have there, but generic pattern is: https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 Best regards, Krzysztof
On 14/11/2022 17:58, Krzysztof Kozlowski wrote: > On 14/11/2022 16:53, Konrad Dybcio wrote: >> >> On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >>> On 14/11/2022 12:17, Konrad Dybcio wrote: >>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>>>>> (hello Qualcomm). Allow it in bindings. >>>>>> >>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>> --- >>>>>> Changes since v1: >>>>>> - Add minItems >>>>>> >>>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>> @@ -159,7 +159,8 @@ properties: >>>>>> through the TCU's programming interface. >>>>>> >>>>>> power-domains: >>>>>> - maxItems: 1 >>>>>> + minItems: 0 >>>>> It cannot be 0. >>>>> >>>>> minItems: 1 >>>>> >>>>> Anyway you still need to restrict it per variant, as I said in previous >>>>> version. >>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>>> compatibles >>> Yes and limit it to maxItems: 1 for "else". >> >> I tried adding: >> >> >> >> - if: >> properties: >> compatible: >> contains: >> enum: >> - qcom,sm6375-smmu-500 >> then: >> properties: >> power-domains: >> minItems: 3 >> maxItems: 3 >> else: >> properties: >> power-domains: >> maxItems: 1 >> >> >> Right under the nvidia reg if-else in the allOf, but dtbs_check throws >> errors like: >> >> >> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: >> iommu@5040000: 'power-domains' does not match any of the regexes: >> 'pinctrl-[0-9]+' >> >> >> Any clues as to why? > > I don't know what code do you have there, but generic pattern is: > > https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 > I tried many things, but I still don't seem to get a hang of it.. Here's my current diff rebased on top of Dmitry's recent cleanups (available at [1]) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index 28f5720824cd..55759aebc4a0 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -200,7 +200,7 @@ properties: maxItems: 7 power-domains: - maxItems: 1 + maxItems: 3 nvidia,memory-controller: description: | @@ -364,6 +364,26 @@ allOf: - description: interface clock required to access smmu's registers through the TCU's programming interface. + - if: + properties: + compatible: + contains: + const: qcom,sm6375-smmu-500 + then: + properties: + power-domains: + items: + - description: SNoC MMU TBU RT GDSC + - description: SNoC MMU TBU NRT GDSC + - description: SNoC TURING MMU TBU0 GDSC + + required: + - power-domains + else: + properties: + power-domains: + maxItems: 1 + examples: - |+ /* SMMU with stream matching or stream indexing */ In my eyes, this should work, but I still get errors like: /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: iommu@3da0000: power-domains: [[108, 0]] is too short as if the else: path was never taken.. [1] https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/log/?h=for-joerg/arm-smmu/bindings Konrad > Best regards, > Krzysztof >
On 15/11/2022 13:54, Konrad Dybcio wrote: > > > On 14/11/2022 17:58, Krzysztof Kozlowski wrote: >> On 14/11/2022 16:53, Konrad Dybcio wrote: >>> >>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >>>> On 14/11/2022 12:17, Konrad Dybcio wrote: >>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>>>>>> (hello Qualcomm). Allow it in bindings. >>>>>>> >>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>>> --- >>>>>>> Changes since v1: >>>>>>> - Add minItems >>>>>>> >>>>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>> >>>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>> @@ -159,7 +159,8 @@ properties: >>>>>>> through the TCU's programming interface. >>>>>>> >>>>>>> power-domains: >>>>>>> - maxItems: 1 >>>>>>> + minItems: 0 >>>>>> It cannot be 0. >>>>>> >>>>>> minItems: 1 >>>>>> >>>>>> Anyway you still need to restrict it per variant, as I said in previous >>>>>> version. >>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>>>> compatibles >>>> Yes and limit it to maxItems: 1 for "else". >>> >>> I tried adding: >>> >>> >>> >>> - if: >>> properties: >>> compatible: >>> contains: >>> enum: >>> - qcom,sm6375-smmu-500 >>> then: >>> properties: >>> power-domains: >>> minItems: 3 >>> maxItems: 3 >>> else: >>> properties: >>> power-domains: >>> maxItems: 1 >>> >>> >>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws >>> errors like: >>> >>> >>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: >>> iommu@5040000: 'power-domains' does not match any of the regexes: >>> 'pinctrl-[0-9]+' >>> >>> >>> Any clues as to why? >> >> I don't know what code do you have there, but generic pattern is: >> >> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 >> > I tried many things, but I still don't seem to get a hang of it.. Here's > my current diff rebased on top of Dmitry's recent cleanups (available at > [1]) > > > diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > index 28f5720824cd..55759aebc4a0 100644 > --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml > @@ -200,7 +200,7 @@ properties: > maxItems: 7 > > power-domains: As I mentioned before - minItems: 1. Just like the link I gave you. > - maxItems: 1 > + maxItems: 3 > > nvidia,memory-controller: > description: | > @@ -364,6 +364,26 @@ allOf: > - description: interface clock required to access smmu's > registers > through the TCU's programming interface. > > + - if: > + properties: > + compatible: > + contains: > + const: qcom,sm6375-smmu-500 > + then: > + properties: > + power-domains: > + items: > + - description: SNoC MMU TBU RT GDSC > + - description: SNoC MMU TBU NRT GDSC > + - description: SNoC TURING MMU TBU0 GDSC > + > + required: > + - power-domains > + else: > + properties: > + power-domains: > + maxItems: 1 > + > examples: > - |+ > /* SMMU with stream matching or stream indexing */ > > > In my eyes, this should work, but I still get errors like: > > /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: > iommu@3da0000: power-domains: [[108, 0]] is too short > > as if the else: path was never taken.. It was, but the top-level property said that minItems=3 (implicitly), so it is too short. Best regards, Krzysztof
On 15/11/2022 14:00, Krzysztof Kozlowski wrote: > On 15/11/2022 13:54, Konrad Dybcio wrote: >> >> >> On 14/11/2022 17:58, Krzysztof Kozlowski wrote: >>> On 14/11/2022 16:53, Konrad Dybcio wrote: >>>> >>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >>>>> On 14/11/2022 12:17, Konrad Dybcio wrote: >>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>>>>> Some SMMUs require that a vote is held on as much as 3 separate PDs >>>>>>>> (hello Qualcomm). Allow it in bindings. >>>>>>>> >>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>>>> --- >>>>>>>> Changes since v1: >>>>>>>> - Add minItems >>>>>>>> >>>>>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>>> >>>>>>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>> @@ -159,7 +159,8 @@ properties: >>>>>>>> through the TCU's programming interface. >>>>>>>> >>>>>>>> power-domains: >>>>>>>> - maxItems: 1 >>>>>>>> + minItems: 0 >>>>>>> It cannot be 0. >>>>>>> >>>>>>> minItems: 1 >>>>>>> >>>>>>> Anyway you still need to restrict it per variant, as I said in previous >>>>>>> version. >>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>>>>> compatibles >>>>> Yes and limit it to maxItems: 1 for "else". >>>> >>>> I tried adding: >>>> >>>> >>>> >>>> - if: >>>> properties: >>>> compatible: >>>> contains: >>>> enum: >>>> - qcom,sm6375-smmu-500 >>>> then: >>>> properties: >>>> power-domains: >>>> minItems: 3 >>>> maxItems: 3 >>>> else: >>>> properties: >>>> power-domains: >>>> maxItems: 1 >>>> >>>> >>>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws >>>> errors like: >>>> >>>> >>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: >>>> iommu@5040000: 'power-domains' does not match any of the regexes: >>>> 'pinctrl-[0-9]+' >>>> >>>> >>>> Any clues as to why? >>> >>> I don't know what code do you have there, but generic pattern is: >>> >>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 >>> >> I tried many things, but I still don't seem to get a hang of it.. Here's >> my current diff rebased on top of Dmitry's recent cleanups (available at >> [1]) >> >> >> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> index 28f5720824cd..55759aebc4a0 100644 >> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >> @@ -200,7 +200,7 @@ properties: >> maxItems: 7 >> >> power-domains: > > As I mentioned before - minItems: 1. But not all SMMUs require a power domain :/ > > Just like the link I gave you. > >> - maxItems: 1 >> + maxItems: 3 >> >> nvidia,memory-controller: >> description: | >> @@ -364,6 +364,26 @@ allOf: >> - description: interface clock required to access smmu's >> registers >> through the TCU's programming interface. >> >> + - if: >> + properties: >> + compatible: >> + contains: >> + const: qcom,sm6375-smmu-500 >> + then: >> + properties: >> + power-domains: >> + items: >> + - description: SNoC MMU TBU RT GDSC >> + - description: SNoC MMU TBU NRT GDSC >> + - description: SNoC TURING MMU TBU0 GDSC >> + >> + required: >> + - power-domains >> + else: >> + properties: >> + power-domains: >> + maxItems: 1 >> + >> examples: >> - |+ >> /* SMMU with stream matching or stream indexing */ >> >> >> In my eyes, this should work, but I still get errors like: >> >> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: >> iommu@3da0000: power-domains: [[108, 0]] is too short >> >> as if the else: path was never taken.. > > It was, but the top-level property said that minItems=3 (implicitly), so > it is too short. So the top-level properties take precedence over the ones that come from the if-then-else?? Ugh. Konrad > > Best regards, > Krzysztof >
On 2022-11-15 13:06, Konrad Dybcio wrote: > > > On 15/11/2022 14:00, Krzysztof Kozlowski wrote: >> On 15/11/2022 13:54, Konrad Dybcio wrote: >>> >>> >>> On 14/11/2022 17:58, Krzysztof Kozlowski wrote: >>>> On 14/11/2022 16:53, Konrad Dybcio wrote: >>>>> >>>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >>>>>> On 14/11/2022 12:17, Konrad Dybcio wrote: >>>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>>>>>> Some SMMUs require that a vote is held on as much as 3 separate >>>>>>>>> PDs >>>>>>>>> (hello Qualcomm). Allow it in bindings. >>>>>>>>> >>>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>>>>> --- >>>>>>>>> Changes since v1: >>>>>>>>> - Add minItems >>>>>>>>> >>>>>>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 ++- >>>>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>>>> >>>>>>>>> diff --git >>>>>>>>> a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>> @@ -159,7 +159,8 @@ properties: >>>>>>>>> through the TCU's programming interface. >>>>>>>>> power-domains: >>>>>>>>> - maxItems: 1 >>>>>>>>> + minItems: 0 >>>>>>>> It cannot be 0. >>>>>>>> >>>>>>>> minItems: 1 >>>>>>>> >>>>>>>> Anyway you still need to restrict it per variant, as I said in >>>>>>>> previous >>>>>>>> version. >>>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>>>>>> compatibles >>>>>> Yes and limit it to maxItems: 1 for "else". >>>>> >>>>> I tried adding: >>>>> >>>>> >>>>> >>>>> - if: >>>>> properties: >>>>> compatible: >>>>> contains: >>>>> enum: >>>>> - qcom,sm6375-smmu-500 >>>>> then: >>>>> properties: >>>>> power-domains: >>>>> minItems: 3 >>>>> maxItems: 3 >>>>> else: >>>>> properties: >>>>> power-domains: >>>>> maxItems: 1 >>>>> >>>>> >>>>> Right under the nvidia reg if-else in the allOf, but dtbs_check throws >>>>> errors like: >>>>> >>>>> >>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: >>>>> iommu@5040000: 'power-domains' does not match any of the regexes: >>>>> 'pinctrl-[0-9]+' >>>>> >>>>> >>>>> Any clues as to why? >>>> >>>> I don't know what code do you have there, but generic pattern is: >>>> >>>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 >>>> >>> I tried many things, but I still don't seem to get a hang of it.. Here's >>> my current diff rebased on top of Dmitry's recent cleanups (available at >>> [1]) >>> >>> >>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> index 28f5720824cd..55759aebc4a0 100644 >>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> @@ -200,7 +200,7 @@ properties: >>> maxItems: 7 >>> >>> power-domains: >> >> As I mentioned before - minItems: 1. > But not all SMMUs require a power domain :/ Right, so it's not a required property. However if it *is* present, then it needs to reference at least one power domain, because having an empty property, i.e.: power-domains = <>; or power-domains; makes no sense whatsoever. Thanks, Robin. > >> >> Just like the link I gave you. >> >>> - maxItems: 1 >>> + maxItems: 3 >>> >>> nvidia,memory-controller: >>> description: | >>> @@ -364,6 +364,26 @@ allOf: >>> - description: interface clock required to access smmu's >>> registers >>> through the TCU's programming interface. >>> >>> + - if: >>> + properties: >>> + compatible: >>> + contains: >>> + const: qcom,sm6375-smmu-500 >>> + then: >>> + properties: >>> + power-domains: >>> + items: >>> + - description: SNoC MMU TBU RT GDSC >>> + - description: SNoC MMU TBU NRT GDSC >>> + - description: SNoC TURING MMU TBU0 GDSC >>> + >>> + required: >>> + - power-domains >>> + else: >>> + properties: >>> + power-domains: >>> + maxItems: 1 >>> + >>> examples: >>> - |+ >>> /* SMMU with stream matching or stream indexing */ >>> >>> >>> In my eyes, this should work, but I still get errors like: >>> >>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: >>> iommu@3da0000: power-domains: [[108, 0]] is too short >>> >>> as if the else: path was never taken.. >> >> It was, but the top-level property said that minItems=3 (implicitly), so >> it is too short. > So the top-level properties take precedence over the ones that come from > the if-then-else?? Ugh. > > Konrad >> >> Best regards, >> Krzysztof >>
On 15/11/2022 14:06, Konrad Dybcio wrote:>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> index 28f5720824cd..55759aebc4a0 100644 >>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>> @@ -200,7 +200,7 @@ properties: >>> maxItems: 7 >>> >>> power-domains: >> >> As I mentioned before - minItems: 1. > But not all SMMUs require a power domain :/ It does not matter. This does not require power-domains. > >> >> Just like the link I gave you. >> >>> - maxItems: 1 >>> + maxItems: 3 >>> >>> nvidia,memory-controller: >>> description: | >>> @@ -364,6 +364,26 @@ allOf: >>> - description: interface clock required to access smmu's >>> registers >>> through the TCU's programming interface. >>> >>> + - if: >>> + properties: >>> + compatible: >>> + contains: >>> + const: qcom,sm6375-smmu-500 >>> + then: >>> + properties: >>> + power-domains: >>> + items: >>> + - description: SNoC MMU TBU RT GDSC >>> + - description: SNoC MMU TBU NRT GDSC >>> + - description: SNoC TURING MMU TBU0 GDSC >>> + >>> + required: >>> + - power-domains >>> + else: >>> + properties: >>> + power-domains: >>> + maxItems: 1 >>> + >>> examples: >>> - |+ >>> /* SMMU with stream matching or stream indexing */ >>> >>> >>> In my eyes, this should work, but I still get errors like: >>> >>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: >>> iommu@3da0000: power-domains: [[108, 0]] is too short >>> >>> as if the else: path was never taken.. >> >> It was, but the top-level property said that minItems=3 (implicitly), so >> it is too short. > So the top-level properties take precedence over the ones that come from > the if-then-else?? Ugh. It's a sum of them. Top level is expected to define the widest constraints and if-then-else narrows them per variants. Best regards, Krzysztof
On 15/11/2022 14:43, Robin Murphy wrote: > On 2022-11-15 13:06, Konrad Dybcio wrote: >> >> >> On 15/11/2022 14:00, Krzysztof Kozlowski wrote: >>> On 15/11/2022 13:54, Konrad Dybcio wrote: >>>> >>>> >>>> On 14/11/2022 17:58, Krzysztof Kozlowski wrote: >>>>> On 14/11/2022 16:53, Konrad Dybcio wrote: >>>>>> >>>>>> On 14/11/2022 14:00, Krzysztof Kozlowski wrote: >>>>>>> On 14/11/2022 12:17, Konrad Dybcio wrote: >>>>>>>> On 14/11/2022 12:01, Krzysztof Kozlowski wrote: >>>>>>>>> On 14/11/2022 11:42, Konrad Dybcio wrote: >>>>>>>>>> Some SMMUs require that a vote is held on as much as 3 >>>>>>>>>> separate PDs >>>>>>>>>> (hello Qualcomm). Allow it in bindings. >>>>>>>>>> >>>>>>>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>>>>>>> --- >>>>>>>>>> Changes since v1: >>>>>>>>>> - Add minItems >>>>>>>>>> >>>>>>>>>> Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 3 >>>>>>>>>> ++- >>>>>>>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>>>>>>> >>>>>>>>>> diff --git >>>>>>>>>> a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>>> index 9066e6df1ba1..82bc696de662 100644 >>>>>>>>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>>>>>>>> @@ -159,7 +159,8 @@ properties: >>>>>>>>>> through the TCU's programming interface. >>>>>>>>>> power-domains: >>>>>>>>>> - maxItems: 1 >>>>>>>>>> + minItems: 0 >>>>>>>>> It cannot be 0. >>>>>>>>> >>>>>>>>> minItems: 1 >>>>>>>>> >>>>>>>>> Anyway you still need to restrict it per variant, as I said in >>>>>>>>> previous >>>>>>>>> version. >>>>>>>> Hm.. I'm not entirely sure what you mean.. Should I add a list of >>>>>>>> compatibles >>>>>>> Yes and limit it to maxItems: 1 for "else". >>>>>> >>>>>> I tried adding: >>>>>> >>>>>> >>>>>> >>>>>> - if: >>>>>> properties: >>>>>> compatible: >>>>>> contains: >>>>>> enum: >>>>>> - qcom,sm6375-smmu-500 >>>>>> then: >>>>>> properties: >>>>>> power-domains: >>>>>> minItems: 3 >>>>>> maxItems: 3 >>>>>> else: >>>>>> properties: >>>>>> power-domains: >>>>>> maxItems: 1 >>>>>> >>>>>> >>>>>> Right under the nvidia reg if-else in the allOf, but dtbs_check >>>>>> throws >>>>>> errors like: >>>>>> >>>>>> >>>>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb: >>>>>> iommu@5040000: 'power-domains' does not match any of the regexes: >>>>>> 'pinctrl-[0-9]+' >>>>>> >>>>>> >>>>>> Any clues as to why? >>>>> >>>>> I don't know what code do you have there, but generic pattern is: >>>>> >>>>> https://elixir.bootlin.com/linux/v5.19-rc6/source/Documentation/devicetree/bindings/clock/samsung,exynos7-clock.yaml#L38 >>>>> >>>> I tried many things, but I still don't seem to get a hang of it.. >>>> Here's >>>> my current diff rebased on top of Dmitry's recent cleanups >>>> (available at >>>> [1]) >>>> >>>> >>>> diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> index 28f5720824cd..55759aebc4a0 100644 >>>> --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml >>>> @@ -200,7 +200,7 @@ properties: >>>> maxItems: 7 >>>> >>>> power-domains: >>> >>> As I mentioned before - minItems: 1. >> But not all SMMUs require a power domain :/ > > Right, so it's not a required property. However if it *is* present, then > it needs to reference at least one power domain, because having an empty > property, i.e.: > > power-domains = <>; > > or > power-domains; > > makes no sense whatsoever. > > Thanks, > Robin. OHHHH! That was the missing piece that made it click for me! Thanks Krzysztof, Robin for guiding me through this. Konrad > >> >>> >>> Just like the link I gave you. >>> >>>> - maxItems: 1 >>>> + maxItems: 3 >>>> >>>> nvidia,memory-controller: >>>> description: | >>>> @@ -364,6 +364,26 @@ allOf: >>>> - description: interface clock required to access smmu's >>>> registers >>>> through the TCU's programming interface. >>>> >>>> + - if: >>>> + properties: >>>> + compatible: >>>> + contains: >>>> + const: qcom,sm6375-smmu-500 >>>> + then: >>>> + properties: >>>> + power-domains: >>>> + items: >>>> + - description: SNoC MMU TBU RT GDSC >>>> + - description: SNoC MMU TBU NRT GDSC >>>> + - description: SNoC TURING MMU TBU0 GDSC >>>> + >>>> + required: >>>> + - power-domains >>>> + else: >>>> + properties: >>>> + power-domains: >>>> + maxItems: 1 >>>> + >>>> examples: >>>> - |+ >>>> /* SMMU with stream matching or stream indexing */ >>>> >>>> >>>> In my eyes, this should work, but I still get errors like: >>>> >>>> /home/konrad/linux/arch/arm64/boot/dts/qcom/sm8250-hdk.dtb: >>>> iommu@3da0000: power-domains: [[108, 0]] is too short >>>> >>>> as if the else: path was never taken.. >>> >>> It was, but the top-level property said that minItems=3 (implicitly), so >>> it is too short. >> So the top-level properties take precedence over the ones that come >> from the if-then-else?? Ugh. >> >> Konrad >>> >>> Best regards, >>> Krzysztof >>>
diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml index 9066e6df1ba1..82bc696de662 100644 --- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml +++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml @@ -159,7 +159,8 @@ properties: through the TCU's programming interface. power-domains: - maxItems: 1 + minItems: 0 + maxItems: 3 nvidia,memory-controller: description: |