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 2AA9CC54E94 for ; Tue, 24 Jan 2023 22:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9/jOtfUwN4OPGYt4ncPeHQk2O5EVVI4YSECGSrIDmcU=; b=ezeT2uLY/MmhCh Cvo6XGoXHhNlNwPJmre383nGtRYMvh5CNFB7IgFkuyfU9DRhP0u2VUkDXvcxZWrPEi9pZ9mDoQZyJ /YszsV4blUk4wxQ613ZHyvmTKmCdX/nKJdR30JL3dUaF+GDHi4RGmcN7nwbDtOQh0pTS5p3pCNLk7 jckrbLVcNiEsUKrKFtZu7CUfqJhTB/odFzRWvNwWa68KNQTX45wdEms1MuSgeZz4WyO1M1UtJlAPp /ZYH5bQo8h6i6CKXR6oV8x1u47tJo1nLJY02H11uEvlpGyRJaI/2580Z/idpou1wcfnSxAyjKtsdB ZiJeRZ7GfRjs9Ezeo6dQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKReo-005UPH-37; Tue, 24 Jan 2023 22:20:46 +0000 Received: from mail-ot1-f54.google.com ([209.85.210.54]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pKRek-005UNy-JK for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2023 22:20:44 +0000 Received: by mail-ot1-f54.google.com with SMTP id k1-20020a056830150100b006864d1cb279so10090270otp.5 for ; Tue, 24 Jan 2023 14:20:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Eez1m+PXfOfMtBkO1erQPzslo6stvsXK/McJNzS+bhE=; b=r2Z3lzdNv1RAgtIV79VTM0xpOT5/I063gVsacniMVp4FVfF/U3BIZb9YVH/UR18rmY SlNElpijuiMKFsKseWr2T/tMEmnMqS8WkCnW8VYKCNfvFPO1cYUAfyceeNPrKVUYaOnc hCP5uzNH2Gx7Xm2m1Sn4H8WwolZYMOOBpDX0dnM5DKV4teug5JQJacsARqWiQ3oP26bQ ZRYSAmQvZiLCJyyV1G2UdutyFCfG+cq4aMhl6qYjfWASeGKwcG7474sHp1XBmfaae1AI HeSaplRth27PDP+Z1+BelVhnCbIK0NWsNvYl9ClsUzlqT+egi9nilMZXnd4Y4j1fVcAQ P/iA== X-Gm-Message-State: AFqh2kr+G2L2l7u61otCpxsQdIbeuIS9Znb8mrECHdON4OXDSUYAHuK5 k3gzpvntnQTHqtI+AK0Bng== X-Google-Smtp-Source: AMrXdXsQOGXLvDUlDyfIhPA3kuz6+QbLmoFpTLE7cXamFILL4fYDaWa2Qf1wZU85+DoB6HyjAsx7SQ== X-Received: by 2002:a05:6830:244d:b0:675:410e:7533 with SMTP id x13-20020a056830244d00b00675410e7533mr16096069otr.9.1674598831857; Tue, 24 Jan 2023 14:20:31 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id a18-20020a9d74d2000000b00684eaf9018csm1449579otl.34.2023.01.24.14.20.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 14:20:31 -0800 (PST) Received: (nullmailer pid 316282 invoked by uid 1000); Tue, 24 Jan 2023 22:20:30 -0000 From: Rob Herring To: Sudeep Holla , Cristian Marussi , Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] dt-bindings: firmware: arm,scmi: Restrict protocol child node properties Date: Tue, 24 Jan 2023 16:20:23 -0600 Message-Id: <20230124222023.316089-1-robh@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230124_142042_657875_D816DEA1 X-CRM114-Status: GOOD ( 10.69 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SCMI protocol child nodes are missing any constraints on unknown properties. Specifically, either 'unevaluatedProperties' or 'additionalProperties' is needed. The current structure with a regex match for all child nodes doesn't work for this purpose, so let's move the common properties '$defs' entry which each specific protocol node can reference and set 'unevaluatedProperties: false'. Signed-off-by: Rob Herring --- .../bindings/firmware/arm,scmi.yaml | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml index 176796931a22..2f7c51c75e85 100644 --- a/Documentation/devicetree/bindings/firmware/arm,scmi.yaml +++ b/Documentation/devicetree/bindings/firmware/arm,scmi.yaml @@ -100,7 +100,9 @@ properties: Channel specifier required when using OP-TEE transport. protocol@11: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x11 @@ -112,7 +114,9 @@ properties: - '#power-domain-cells' protocol@13: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x13 @@ -124,7 +128,9 @@ properties: - '#clock-cells' protocol@14: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x14 @@ -136,7 +142,9 @@ properties: - '#clock-cells' protocol@15: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x15 @@ -148,7 +156,9 @@ properties: - '#thermal-sensor-cells' protocol@16: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x16 @@ -160,20 +170,31 @@ properties: - '#reset-cells' protocol@17: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x17 regulators: type: object + additionalProperties: false description: The list of all regulators provided by this SCMI controller. + properties: + '#address-cells': + const: 1 + + '#size-cells': + const: 0 + patternProperties: - '^regulators@[0-9a-f]+$': + '^regulator@[0-9a-f]+$': type: object $ref: "../regulator/regulator.yaml#" + unevaluatedProperties: false properties: reg: @@ -184,15 +205,17 @@ properties: - reg protocol@18: - type: object + $ref: '#/$defs/protocol-node' + unevaluatedProperties: false + properties: reg: const: 0x18 additionalProperties: false -patternProperties: - '^protocol@[0-9a-f]+$': +$defs: + protocol-node: type: object description: Each sub-node represents a protocol supported. If the platform -- 2.39.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel