All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@arm.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Mao Jinlong <quic_jinlmao@quicinc.com>,
	Hao Zhang <quic_hazha@quicinc.com>,
	Tao Zhang <quic_taozha@quicinc.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/3] dt-bindings: arm: coresight: restrict single port subnodes
Date: Fri, 8 Dec 2023 14:24:36 -0600	[thread overview]
Message-ID: <20231208202436.GA2627018-robh@kernel.org> (raw)
In-Reply-To: <20231206115332.22712-1-krzysztof.kozlowski@linaro.org>

On Wed, Dec 06, 2023 at 12:53:30PM +0100, Krzysztof Kozlowski wrote:
> "in-ports" and "out-ports" with single "port" subnode should use
> "additionalProperties: false" to disallow any other properties mentioned
> by graph schema which are not applicable for this case, e.g.
> "address-cells".

The graph schema should already check this case with this subschema:

    oneOf:
      - required:
          - port
      - required:
          - "#address-cells"
          - "#size-cells"

However, I now see this would allow port and #address-cells if 
#size-cells is omitted. (#address-cells is a dependency for 
##size-cells, but not vice-versa because interrupt-controllers can have 
##just #address-cells). Perhaps this should instead be:

    oneOf:
      - required:
          - port
      - anyOf:
	  - required:
              - "#address-cells"
	  - required:
              - "#size-cells"

We're missing a similar check on endpoint. Or I'm forgetting why I 
didn't add it.

I suspect there are a lot more cases if we fixed these in the users.

Rob

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
	Mike Leach <mike.leach@linaro.org>,
	James Clark <james.clark@arm.com>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Mao Jinlong <quic_jinlmao@quicinc.com>,
	Hao Zhang <quic_hazha@quicinc.com>,
	Tao Zhang <quic_taozha@quicinc.com>,
	coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 1/3] dt-bindings: arm: coresight: restrict single port subnodes
Date: Fri, 8 Dec 2023 14:24:36 -0600	[thread overview]
Message-ID: <20231208202436.GA2627018-robh@kernel.org> (raw)
In-Reply-To: <20231206115332.22712-1-krzysztof.kozlowski@linaro.org>

On Wed, Dec 06, 2023 at 12:53:30PM +0100, Krzysztof Kozlowski wrote:
> "in-ports" and "out-ports" with single "port" subnode should use
> "additionalProperties: false" to disallow any other properties mentioned
> by graph schema which are not applicable for this case, e.g.
> "address-cells".

The graph schema should already check this case with this subschema:

    oneOf:
      - required:
          - port
      - required:
          - "#address-cells"
          - "#size-cells"

However, I now see this would allow port and #address-cells if 
#size-cells is omitted. (#address-cells is a dependency for 
##size-cells, but not vice-versa because interrupt-controllers can have 
##just #address-cells). Perhaps this should instead be:

    oneOf:
      - required:
          - port
      - anyOf:
	  - required:
              - "#address-cells"
	  - required:
              - "#size-cells"

We're missing a similar check on endpoint. Or I'm forgetting why I 
didn't add it.

I suspect there are a lot more cases if we fixed these in the users.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2023-12-08 20:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-06 11:53 [PATCH 1/3] dt-bindings: arm: coresight: restrict single port subnodes Krzysztof Kozlowski
2023-12-06 11:53 ` Krzysztof Kozlowski
2023-12-06 11:53 ` [PATCH 2/3] dt-bindings: arm: qcom,coresight-tpda: drop redundant type from ports Krzysztof Kozlowski
2023-12-06 11:53   ` Krzysztof Kozlowski
2023-12-08 20:25   ` Rob Herring
2023-12-08 20:25     ` Rob Herring
2023-12-06 11:53 ` [PATCH 3/3] dt-bindings: arm: qcom,coresight-tpda: fix indentation in the example Krzysztof Kozlowski
2023-12-06 11:53   ` Krzysztof Kozlowski
2023-12-08 20:25   ` Rob Herring
2023-12-08 20:25     ` Rob Herring
2023-12-08 20:24 ` Rob Herring [this message]
2023-12-08 20:24   ` [PATCH 1/3] dt-bindings: arm: coresight: restrict single port subnodes Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231208202436.GA2627018-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=coresight@lists.linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=james.clark@arm.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mike.leach@linaro.org \
    --cc=quic_hazha@quicinc.com \
    --cc=quic_jinlmao@quicinc.com \
    --cc=quic_taozha@quicinc.com \
    --cc=suzuki.poulose@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.