Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp34629lqp; Tue, 11 Jun 2024 13:40:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXGVKyqYOTKR9fk3Jlwc2/i92KyPOx6RLNIUSKcRXzc1HGPYe0twiynF4jZCgs/dtFbe89eYgR6knJM48TqF2hx+ryPUQs79eCF77J4fQ== X-Google-Smtp-Source: AGHT+IGS/778uiFj3o49xKa7LrjWmK70AsgpvGviyC/kZJ3RYm7hSo9m93JMuFabkg7T5zUHpJOT X-Received: by 2002:a17:906:7c4:b0:a6e:e4dd:d8b9 with SMTP id a640c23a62f3a-a6ee4ed1b59mr701244666b.46.1718138423511; Tue, 11 Jun 2024 13:40:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718138423; cv=pass; d=google.com; s=arc-20160816; b=hKsHRQjzezuEpoR3lTEz6zTezpeqWwF22I9XePqcsq1+97ffY8849Sw72+btNCKdpT YRaxYq2HGBe6ZVIyysOV2apTYhZWYeFZ9QQ4f5aXk66/uL/6OxhWmPRoWGhoRdgSXj2n uD3UNymS3C06lmGx6CHz7pe0aWpHLtwjUNzz6VbfZzyGNAlQqu9cF9cNyqqLhIsx5zyw WVw2VKqSlw9JCh6Lm3WddEDyLYHyf2pGsDJ4pYHHITAUZtsgg60MhhRnlvzwYhGP22uM xmtB0Q0K1uzBrsxPXWaajUBe4iCc+GrJH6El8pN/GUZKhA12ZQT0DJ6vHfAGSYiQAGdP +aZA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UKpOXORYFgMfrh0gr/nFZCLibwblsPJVPPwATe7LeGY=; fh=+2VOlwdflj/f5nGOChAmjJnmlQS5+mFJN9QMJRnneTA=; b=h0DTCeN442NDQ3ehYiJZj8sZdUeV23dB5O4plVm+HAVQhNQ+sESdSDadMUqjLQQ0pm 8B/YbLc7X0B2I1vV6O7b7vCW4tSW6uaC+YsnNmRIpMHyIuy4fouqLer53+4DYYI1TGil fGZ8bgfe+M/5yT1+9a38d+LAjPmogaW8xaKFwQ3ZHU570IGVb9Xqi5PN/MasoWSSP5SZ kQLep0Y83pxTu1/LFo4z8LPiLbqvrNkPbOPURY9DXPUMgf1v6Vp46vclV/KHmbYNyW27 NA/jQ6yuOuROfIaKwgshYNr8e6pZTVg1Jc5av+wgqOXwJUobJ/5vYZyrznelQMproO4P VR2w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gNbbr/GI"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6ee6d275d2si443888166b.419.2024.06.11.13.40.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 13:40:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gNbbr/GI"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0F4B21F21EA4 for ; Tue, 11 Jun 2024 20:40:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81E75152DE0; Tue, 11 Jun 2024 20:40:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gNbbr/GI" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 958793839C; Tue, 11 Jun 2024 20:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718138403; cv=none; b=N/UlgSfqhFLOs8l8sXRvrKRC7fD/2BhDBCPnEDrOSFt2H2KWIhSXv6gKI2rnkQ4WCDqVX7EzVapyQoYxO30eJpdqx+ZyxOKvGpqDsdmh1ye4znTu4fmizGp6Wip7lfw8pbnp96WY1rTsjOXpzHQNdtQUs/mLky5wMaCu81QYczw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718138403; c=relaxed/simple; bh=Fc2HEeo9okemeHUxDvZyvIytBDjmzwdqdSkla9vn06k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iGLrmRpJsA0XHaOn1SP4WpJRsqaZqJiuM6cnAGobQnRfmh9iODE0Jjxb5sr9nZjAy2da2BZhQH6+2EpKFqRfN+OoSCqdSHypzD23JexMoseTv8GQW2CCdBlwBHDFlraHxKCVwQsQ7fD5qMfscEW3NrEeyfVsKuHvIgRv+69LaU4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gNbbr/GI; arc=none smtp.client-ip=10.30.226.201 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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> 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 >