๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24950

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

#24950
From: Rob Herring
Date: Tue, 01 Dec 2026 03:32
107 lines
12344 bytes
On Mon, Nov 23, 2026 at 04:11:53PM +0000, netdev-bot+sashiko@kernel.org wrote:
> 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).

Yes.

> 
> 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?

Yes.

There's a whole other class of schemas here that don't put any 
restriction on the port numbers. Maybe they should, but doing so 
requires knowing how many ports there are. But that would be a separate 
improvement rather than fixing what looks like a constraint on number of 
ports but in reality isn't doing anything. And that could get messy when 
you have several variants with different numbers of ports covered by 1 
schema.

Rob
Technical Details
Message-ID: <20261201033206.GA4066057-robh@kernel.org>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374681-linux-kernel-netdev=dewy.ru
References: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com> <179545031306.3135.11482802242328622537@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374681-linux-kernel-netdev=dewy.ru
From: robh@kernel.org (Rob Herring)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected
 ethernet ports
Date: Mon, 30 Nov 2026 21:32:06 -0600
Organization: Usenet Network
Message-ID: <20261201033206.GA4066057-robh@kernel.org>
References: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com>
 <179545031306.3135.11482802242328622537@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1603829"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Rup9MygzD/Z6d95PmhOCqfb16NQ= sha256:Vr25b8najJpGrp/5liiBho5QKOrHAQ6vXUl3UpiDPqU=
	sha1:RExq3nJs4du1tSjzz/v+F7IuFiQ= sha256:ok6KgkRYur9zKSumggZMhYrxGRmYADXZVjZ/NO2iPI0=
Content-Disposition: inline
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 13AC2126013; Tue,  1 Dec 2026 06:32:29 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 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] 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 RS0dhpEWN_C5;
	Tue,  1 Dec 2026 06:32: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-374681-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 EABA812600C; Tue,  1 Dec 2026 06:32:11 +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 47DDD2816F; Tue,  1 Dec 2026 03:32:10 +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=1796095930;
	b=VwrFVw4plKYPM3QzPCGoFu1vKojz97C/eksBwe0l5aNtb5c3ltTZW22HOqxr6Q/u1i19
	 je0NWaBb3R0qkveiHisIqYOSpp3N6kQv7SynYN90X79URNfPi5gxJiVfsNk5Qz/7s+o2v
	 GzR+6Iqsp+eiQcJOX4sghn5H9kdDjVNqaYRptuPchjr7wMdELLgdvc28DoN4gL4zBUSJ1
	 pwnV51oEkGG4bq7eMBzv2Y4ehtyJidyTWC7VP12+Z8FrO+zx6nZowZcWtEbt8wi7OY5J/
	 Nd364x/0Eov2o6u8qmu1ozS8kl+BasltFBvsyJxjUj8cWtqu4sn3ME3PVpwROliLIbQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796095930;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=kgXT4OXPVzZn5ffnSulxmcp1ZihxSCBoC3eA0glvgc0=;
	b=GZLefAMZP7yHRg/GJL157jhCtpU37knJ64fUXwVlXnTNQ/4EdVt7xR9OejJxhv3Zf3Sk
	 geeTkGiVd5aORSXv9NO5sYKrXZ3WVgpW0SDxZB2SpoQPUnUl+cD6F0bFo8m1uNLFUN6+D
	 CMtsDS+4YbmBnD7djF0IQ48B5OJcqF7zBrYFYwBLnaNUMNoHUaUgXFSDETerkFElFx6N4
	 fifKTNwBM1xubXIz0rk9iCvUMllCrmTnK/vH7S5IAUI0QroDvLheb5afNCuxj+lsKj6iI
	 ycr6aH5/oLGrfJ1nKZQAtoAWUwOoy6B8CfhWjanyqKDd2yus2beq0w8fyKbQPNDj0Iw==
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=CVacBgb8;
	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 F2FBE606A330;
	Tue,  1 Dec 2026 03:32:09 +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=CVacBgb8
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=1796095929;
	b=hiwszoQ67M6oSSL6CQpq2L99TW4YWTljqTZzqax8agYc7214f5sHBUQtH60b79t4QK4n
	 wz4ih38nWzG5wm3D+RCzUE1zjmZ7R6FTZ8YM1JN5Gr5hrak89yJ2avmziw25LPBJ2/x+9
	 EPv9MTUh16WeIOf4CLNw56MwltAP7/VPBFL64lLyEfp9cA0yWVd9zFSPP5E6FRQnimRLx
	 TkJ5K/3K6Pr59Faj6/1RCI45S7xlaQ69zLyHkjrLkRc8Sgs7lwEgudiaoO0p4sbTTM2xm
	 XNSYHKplJ1jfeXMWJC3pYIxJLHh1ldADWp0D5Jq6FhDfrpljSsmRp0zsJRt8aH6tfCQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796095929;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:
	 Content-Transfer-Encoding:In-Reply-To;
	bh=kgXT4OXPVzZn5ffnSulxmcp1ZihxSCBoC3eA0glvgc0=;
	b=G5LnvroEZD0TAbPnuTz4XlwVtRHNNzEqY/weF5nPzQhnL2T65kL8PsFKcAzXr9mkyjo+
	 /sLBomnq7H1zMSI52TfprHjIgs6x94T17+5u2vurmdXii0FDkrJH6TFVYcP1+GMJryQcc
	 Przyvk340VhK0t2mrdjRezeanrFp0c/OsRwPtJSvB2t8OoPNeKcvLNM/svVA123V883ib
	 E1OVxKaPyPJxM1VLnd2AO/E13BflgzCCd8HoQLDBQ6ioetailwm8SpkjxB9pI9/beAzc6
	 W+XsUxWmSXtqGkcV6ibdB+wKrTWJssXFDlwXJBvJKxoZ00uKZDfPnRY8w5ZcAzTHRrg==
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=CVacBgb8;
	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 19C73606A320;
	Tue,  1 Dec 2026 03:32:09 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1FD91F000C1;
	Tue,  1 Dec 2026 03:32:08 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1796095928;
	bh=kgXT4OXPVzZn5ffnSulxmcp1ZihxSCBoC3eA0glvgc0=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=CVacBgb8wwQrlept3AGQv31myM7IAviaA9CrvSmvoWCJIeN8csBH2NAWHhBYcnvuq
	 XnARaDI5bxjZHkub+mpsCDV8KLDiV3orc8tUnRCKRhbMELO4FFWO8dEoz6JVp8ypFI
	 WBkrZ39b66uPlZIdL6pyR7RrcjYDptYWkhl1GnXXZkaMtakiVJo+dUWgxbFORCITHI
	 roFhkyGCgMw3z4m8CjApRQswFVngKo4EeEBul2wGyeSJE1EwoGqT1eoiT2gMO2+oxb
	 gczCNI7ioqm2QSZwQCRbIHAJI2BmVZ2VkYs/L7eMqvMqQT2zfTS1HQmOXRWhIb73xz
	 qBPgJpURkMt2g==
X-Cc: krzysztof.kozlowski@oss.qualcomm.com, hauke@hauke-m.de, andrew@lunn.ch,
	olteanv@gmail.com, davem@davemloft.net, edumazet@kernel.org,
	kuba@kernel.org, pabeni@redhat.com, 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-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
X-In-Reply-To: <179545031306.3135.11482802242328622537@kernel.org>