From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 43DF0C27C75 for ; Tue, 11 Jun 2024 20:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=UKpOXORYFgMfrh0gr/nFZCLibwblsPJVPPwATe7LeGY=; b=S4QKbQh8Ls8WlqeAPz1yYUmsCy G/0jiSMtFs9PBrUNu/uqk4HUTNBe6nz/GAkaLpSkJoWAvq2jypUGU10/r/5iBpJlG1ARKeAdvV9zv fDxy7914nRtI2jb2YaYeDF0BqQr+KiH1E4JMMwfkk/QeKpcbKzpJo0OMo4wU/YRz8VKeCIoOPNDAM bfDJHlGETSiJAwo1tl2WJ5kGiYODvAH3D64HtjwuImbeXEFysE2XJo5ZM4wp2u1/fNXu3Nf/9RU2N tDAOcciea+KNS8GKbkdy4rVIk/IW4J1fHh8BqG89Il+vWC8aJejx7ZXqP6ZrotX4nTuG4HyKcLEJQ JET4fgzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH8Hp-0000000ABun-0ZbG; Tue, 11 Jun 2024 20:40:09 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sH8Hl-0000000ABtI-3vRF for linux-arm-kernel@lists.infradead.org; Tue, 11 Jun 2024 20:40:07 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CC13BCE0171; Tue, 11 Jun 2024 20:40:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C76A2C3277B; Tue, 11 Jun 2024 20:40:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718138403; bh=Fc2HEeo9okemeHUxDvZyvIytBDjmzwdqdSkla9vn06k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gNbbr/GIbov1z2/M0ZncN5ndZNY+RGEhOS3BIuFYzXKt8Ix1x4gvYDNrWS9/yq40I 6lXvO+02Y5iwtyyg2Dgwgy1ZryBRF/gdz+iqST9EQ+152f+ciYHW5Qf5aUBK7W7Kzi VTD8q9PmcNkGtujnalwAQL/x6WOrxSyiplUw2qbNu//8Mk5ZZSpkP14nmgASSoZQK7 pvvDqmUMcSw9B0BeHuKLeL5/GeoouKM8LvPxnorq9e3jUzQVyqihdi6ceYa78xZREu mKzMS9Xab+GFv0Jbvyrubj5oLR/zkYuW6phmvv8UYJ2QVOx9ZZgfObZkisaaFtrm3C yFV8OoRy5gYIA== Date: Tue, 11 Jun 2024 14:40:01 -0600 From: Rob Herring To: Elliot Berman Cc: Bjorn Andersson , Konrad Dybcio , Sebastian Reichel , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Andy Yan , Lorenzo Pieralisi , Mark Rutland , Bartosz Golaszewski , Satya Durga Srinivasu Prabhala , Melody Olvera , Shivendra Pratap , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Florian Fainelli , 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 Message-ID: <20240611204001.GA3026541-robh@kernel.org> References: <20240611-arm-psci-system_reset2-vendor-reboots-v4-0-98f55aa74ae8@quicinc.com> <20240611-arm-psci-system_reset2-vendor-reboots-v4-1-98f55aa74ae8@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240611-arm-psci-system_reset2-vendor-reboots-v4-1-98f55aa74ae8@quicinc.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240611_134006_421979_05B8B39C X-CRM114-Status: GOOD ( 19.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > --- > .../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 >