All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Elliot Berman <quic_eberman@quicinc.com>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Sebastian Reichel <sre@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>, Vinod Koul <vkoul@kernel.org>,
	Andy Yan <andy.yan@rock-chips.com>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Bartosz Golaszewski <bartosz.golaszewski@linaro.org>,
	Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
	Melody Olvera <quic_molvera@quicinc.com>,
	Shivendra Pratap <quic_spratap@quicinc.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Florian Fainelli <florian.fainelli@broadcom.com>,
	linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v4 1/4] dt-bindings: power: reset: Convert mode-.* properties to array
Date: Tue, 11 Jun 2024 14:40:01 -0600	[thread overview]
Message-ID: <20240611204001.GA3026541-robh@kernel.org> (raw)
In-Reply-To: <20240611-arm-psci-system_reset2-vendor-reboots-v4-1-98f55aa74ae8@quicinc.com>

On Tue, Jun 11, 2024 at 08:35:13AM -0700, Elliot Berman wrote:
> PSCI reboot mode will map a mode name to multiple magic values instead
> of just one. Convert the mode-.* property to an array. Users of the
> reboot-mode schema will need to specify the maxItems of the mode-.*
> properties. Existing users will all be 1.
> 
> Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
> ---
>  .../devicetree/bindings/power/reset/nvmem-reboot-mode.yaml        | 5 +++++
>  Documentation/devicetree/bindings/power/reset/qcom,pon.yaml       | 8 ++++++++
>  Documentation/devicetree/bindings/power/reset/reboot-mode.yaml    | 4 ++--
>  .../devicetree/bindings/power/reset/syscon-reboot-mode.yaml       | 5 +++++
>  4 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.yaml
> index 627f8a6078c2..9b9bbc0f29e7 100644
> --- a/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.yaml
> @@ -31,6 +31,11 @@ properties:
>  allOf:
>    - $ref: reboot-mode.yaml#
>  
> +patternProperties:
> +  "^mode-.*$":
> +    items:
> +      maxItems: 1

Drop 'items'. Otherwise, you are defining constraints of a matrix.

> +
>  required:
>    - compatible
>    - nvmem-cells
> diff --git a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> index fc8105a7b9b2..4c87ff5ecc9a 100644
> --- a/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/qcom,pon.yaml
> @@ -54,6 +54,11 @@ required:
>    - compatible
>    - reg
>  
> +patternProperties:
> +  "^mode-.*$":
> +    items:
> +      maxItems: 1
> +
>  unevaluatedProperties: false
>  
>  allOf:
> @@ -75,6 +80,9 @@ allOf:
>          reg-names:
>            items:
>              - const: pon
> +    else:
> +      patternProperties:
> +        "^mode-.*$": false
>  
>      # Special case for pm8941, which doesn't store reset mode
>    - if:
> diff --git a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
> index ad0a0b95cec1..523602fb82d2 100644
> --- a/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/reboot-mode.yaml
> @@ -28,13 +28,13 @@ description: |
>  
>  properties:
>    mode-normal:
> -    $ref: /schemas/types.yaml#/definitions/uint32
> +    $ref: "#/patternProperties/^mode-.*$"

No need for this. The pattern schema will be applied already. Also, a 
$ref to a regex is fragile as it won't work for some regex patterns.

>      description:
>        Default value to set on a reboot if no command was provided.
>  
>  patternProperties:
>    "^mode-.*$":
> -    $ref: /schemas/types.yaml#/definitions/uint32
> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>  
>  additionalProperties: true
>  
> diff --git a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> index b6acff199cde..e9d2e3b27885 100644
> --- a/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> +++ b/Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml
> @@ -32,6 +32,11 @@ properties:
>  allOf:
>    - $ref: reboot-mode.yaml#
>  
> +patternProperties:
> +  "^mode-.*$":
> +    items:
> +      maxItems: 1
> +
>  unevaluatedProperties: false
>  
>  required:
> 
> -- 
> 2.34.1
> 

  reply	other threads:[~2024-06-11 20:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 15:35 [PATCH v4 0/4] Implement vendor resets for PSCI SYSTEM_RESET2 Elliot Berman
2024-06-11 15:35 ` Elliot Berman
2024-06-11 15:35 ` [PATCH v4 1/4] dt-bindings: power: reset: Convert mode-.* properties to array Elliot Berman
2024-06-11 15:35   ` Elliot Berman
2024-06-11 20:40   ` Rob Herring [this message]
2024-06-11 23:23     ` Elliot Berman
2024-06-13 17:35       ` Rob Herring
2024-06-11 15:35 ` [PATCH v4 2/4] dt-bindings: arm: Document reboot mode magic Elliot Berman
2024-06-11 15:35   ` Elliot Berman
2024-06-11 15:35 ` [PATCH v4 3/4] firmware: psci: Read and use vendor reset types Elliot Berman
2024-06-11 15:35   ` Elliot Berman
2024-06-11 15:35 ` [PATCH v4 4/4] arm64: dts: qcom: Add PSCI SYSTEM_RESET2 types for qcm6490-idp Elliot Berman
2024-06-11 15:35   ` Elliot Berman

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=20240611204001.GA3026541-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=andersson@kernel.org \
    --cc=andy.yan@rock-chips.com \
    --cc=bartosz.golaszewski@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_molvera@quicinc.com \
    --cc=quic_satyap@quicinc.com \
    --cc=quic_spratap@quicinc.com \
    --cc=sre@kernel.org \
    --cc=vkoul@kernel.org \
    /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.