๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21153

Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports

#21153
From: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 16:11
94 lines
11733 bytes
Thank you for your contribution! Sashiko AI review found 1 potential
issue(s) to consider.

Critical: 0 ยท High: 1 ยท Medium: 0 ยท Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] The fix is incomplete because it skips a sibling DSA binding
  that has the exact defect described in the commit message.

--

dt-bindings: net: dsa: Flag unexpected ethernet ports

Several DSA bindings reference dsa.yaml ports, use "additionalProperties:
true", and limit their port node pattern to a subset of unit addresses.
Because of that, port nodes with any other unit address pass validation
without a warning. The patch drops the unit address from the pattern and
limits the port reg value with a maximum instead.

[ ... ]

> diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
> index 167398ab253aa..3840b336bdb93 100644
> --- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
> @@ -75,13 +75,15 @@ patternProperties:
>      type: object
>      additionalProperties: true
>      patternProperties:
> -      "^(ethernet-)?port@[0-6]$":
> +      "^(ethernet-)?port@":
>          type: object
>          description: Ethernet switch ports
>  
>          $ref: dsa-port.yaml#
>  
>          properties:
> +          reg:
> +            maximum: 6

[Severity: High]
Was renesas,rzn1-a5psw.yaml left out of this conversion on purpose? It
looks like it has the same problem the commit message describes. It
references dsa.yaml ports, its ethernet-ports node uses
additionalProperties: true, and its port pattern still limits the unit
address:

Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml:

allOf:
  - $ref: dsa.yaml#/$defs/ethernet-ports
...
  ethernet-ports:
    type: object
    additionalProperties: true
    patternProperties:
      "^(ethernet-)?port@[0-4]$":

Under a renesas,rzn1-a5psw switch, a node such as port@5 or port@7 does
not match this pattern. It does match the generic
"^(ethernet-)?port@[0-9a-f]+$" pattern in dsa.yaml, so only the generic
dsa-port.yaml checks apply and it passes validation. This hardware only
has ports 0-4 (4 ports plus 1 CPU port).

Would the same change used here for qca8k.yaml work for that file too,
i.e. "^(ethernet-)?port@" plus reg: maximum: 4?

nxp,netc-switch.yaml has a weaker form of the same gap:

  ethernet-ports:
    type: object
    patternProperties:
      "^ethernet-port@[0-9a-f]$":
        type: object
        $ref: dsa-port.yaml#

A node named port@1 (no ethernet- prefix) or ethernet-port@10 does not
match this pattern. Instead it matches the
'^(ethernet-)?port@[0-9a-f]+$' pattern in ethernet-switch.yaml, which is
reached through $ref: dsa.yaml# and only applies type: object.

Such a node skips the NETC port schema, including dsa-port.yaml and its
unevaluatedProperties: false, and passes without a warning.

Should this patch cover nxp,netc-switch.yaml as well?

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261122160907.200727-3-krzysztof.kozlowski%40oss.qualcomm.com
Technical Details
Message-ID: <179545031306.3135.11482802242328622537@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369568-linux-kernel-netdev=dewy.ru
References: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369568-linux-kernel-netdev=dewy.ru
From: netdev-bot+sashiko@kernel.org
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected
 ethernet ports
Date: Mon, 23 Nov 2026 16:11:53 +0000
Organization: Usenet Network
Message-ID: <179545031306.3135.11482802242328622537@kernel.org>
References: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="3924879"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:5e9XVLdeCNra9ZvJst0wYDwKXIw= sha256:N60E/BvwBT9jthiVFCY9J/2Xjm2S5gPxMVjOUaS3TnI=
	sha1:c3yErIZPQJDMMqYfc5U/ihhaOPs= sha256:ItiTdQ3/K02R5LfimVqeJ7yDShCb71BRuUOSx9NZU+k=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id DB4CA125DBD; Mon, 23 Nov 2026 19:12:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.4
X-Spam-Status: No, score=-3.4 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id tojCSiirIZgl;
	Mon, 23 Nov 2026 19:12:22 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369568-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 3001E125DB9; Mon, 23 Nov 2026 19:12:12 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id A85B42F4AC; Mon, 23 Nov 2026 16:12:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795450326;
	b=p0cJQjOouq7ajOjYmM/Cq2ldZ1cLlgLLm9GA0t0I2nbnqwj/fFjNScsoWRwpVC8o2RCL
	 a0yviZnAMpmNxbnHFX/5AQx1goLXgN4TTZrFQHDszn+TztVjT63UpwAs/jPwOzDcOjnyc
	 23Wle/oBP4jicswklONK9IoiHypfd1CHav06zRxnroyCCQdulrUs+5yx+wCKfr7hq66pl
	 BD9UNYGc+q8STfgx/0zejtpUNIYn9gPAZCHdyL4PH/Nc6SSCPbtTF6Ic86TN6EPrvYqWT
	 AYtUJVIrcXx+B4E64R3ddm82L+3k15sq7W/VcngxMVnXbwtwnfZNJCjemta1McuZtQA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795450326;
	h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc:
	 Date:Message-ID:In-Reply-To:References:X-sashiko-severity:
	 Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version;
	bh=CuV1HgSyHeqmHnQ6X0W8EKjH6rdyvaViJZVeUHENJ3o=;
	b=RNBAKPW9X/3IBWV2CsN4X/glw+PqDmCkS+5mEK74E/kjJQk1VDSPHOq7h/A4TcsbUOkn
	 IFJFnhJYEG99LEz83y/zlQ50hY7C8loCYjj15v//FtQHHjT/RuFhaHcHdyowjuoTy9VJh
	 q3SKAZK23K8YgMpySdr/G5hoBmSSKqzg3TXFPoacAZmb6lyzbGZEMvcGM0Wav9N76MutU
	 LS8SmVPGrkverAkkmR5A7AvTDPPbjeeDa96q52vZGZLt/cfvuBryuj6gsuuN46bJV0jzX
	 tBIRAmt3qHusg2ISjtJz7Bum0hybkSt6yxTxyaQlVdr+blRmmX1ITOD+EJV+3Qv/v5Q==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I7cdb4vd;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 7F352606A31A;
	Mon, 23 Nov 2026 16:12:06 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I7cdb4vd
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795450315;
	b=LpKpJ6rP/3xYQElJZtaEEgIR1DNHBbl3oMDzOcKd5sD1dAkMoYnVBDIuCZjj9tp9dS7N
	 S8ihBgy6a4jqpE/87CxkWb8/TEVEMZuS6DJoYDiL8518HlFWezFn/fQuNBtzZzMYnxuER
	 LDUOcNcVvCEO1dVS9JxIfsOav2GH4LIREjnOmsyB5lcgbGZa8MnRCr0MgWn9mzjRjIbfW
	 GFVh3Se9VxaQ7iBS7IurskXLVdTOcX4/dhWtoZcJzHd8Mp8iuK4xujJOPkKr5oZw0G1fP
	 3FYT1vqPxrXHDohO2efDo22597ftWpKogvlAxwG39g8LPbcb9XYo4XQ52wCsc0+oNZA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795450315;
	h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID:
	 In-Reply-To:References:X-sashiko-severity:Content-Type:
	 Content-Transfer-Encoding:MIME-Version;
	bh=CuV1HgSyHeqmHnQ6X0W8EKjH6rdyvaViJZVeUHENJ3o=;
	b=e2YtJA1QKnM4f8B0lZtFJ3pST8l9DAIoZrvws5ZG1nsAOmkGUIAtHpLTSxAnzbtA1z9b
	 Ln4IyGARcdDR8uAdbQ1tUzzugnNpGAkYTmDEeIstDyYdtEqB6BzEyWHqMTasCtHFyTGsX
	 UZXwd6pxeNekLj/R+b0PCCYldOXANNsEzF/qn3N5M4MryxfkS2JsZO4ouhsaaJotm7+Eq
	 CngijahIGCgD994OwXEBaKqoABkT5MpqqhgHDYBQ2wGKS5adZsbkZLFMocIaHc0tinAhR
	 H9R4FxhHeJJApUPhD0wi5m+gPf+2tbc3HXDrC2cjdEYSJU+Iyn/l7zWt99mFzQFwKGA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I7cdb4vd;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B443606A31E;
	Mon, 23 Nov 2026 16:11:55 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89A5E1F000C0;
	Mon, 23 Nov 2026 16:11:53 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795450315;
	bh=CuV1HgSyHeqmHnQ6X0W8EKjH6rdyvaViJZVeUHENJ3o=;
	h=Subject:From:To:Cc:Date:In-Reply-To:References;
	b=I7cdb4vdNUK3v3piY+BZlJjEe9R4MEyMtBgnxanHlmElStgvqGfQY7m05L2McBrOR
	 VP+sk9kRQ+s6g7KtRfwY1IGa/cRy5HXcbrKutTfHWiHSdpSGmhzT2snp63v0kVxoPP
	 D61kJ8ra9i6aLDn7pdM82YRC39mtoLm+pEdt28w6iLFn2sYZknfRXOwISv/FM3j447
	 d8OreZirnkqEWu7JNN9y41OAQcEAUcPYoV2mGz3YuP8hvByYVXaDF5jhMXpDRAwBDK
	 98UKa8QcdVSbM0GLaB87W8AMcxgfQMC03x9D4Rc++I920eQzGHmX5MGcXkTqRzy2mZ
	 WIcA6ugK5QGbA==
X-Cc: hauke@hauke-m.de, andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
 edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
 krzk+dt@kernel.org, conor+dt@kernel.org, matthias.bgg@gmail.com,
 angelogioacchino.delregno@collabora.com, woojung.huh@microchip.com,
 UNGLinuxDriver@microchip.com, jensemil.schulzostergaard@microchip.com,
 ansuelsmth@gmail.com, arinc.unal@arinc9.com, Landen.Chao@mediatek.com,
 dqfext@gmail.com, sean.wang@mediatek.com, daniel@makrotopia.org,
 marex@denx.de, john@phrozen.org, netdev@vger.kernel.org,
 devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
 linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org
X-In-Reply-To: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com>
X-sashiko-severity: High
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list