From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7EB3C606A320 for ; Tue, 1 Dec 2026 03:32:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IMB+gcVv; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=CVacBgb8 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-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=kgXT4OXPVzZn5ffnSulxmcp1ZihxSCBoC3eA0glvgc0=; b=IMB+gcVv+5GKYrIBDPCaQ1qw4k bO+RxnTysV0xNtViGk1iqyOwusS2M4U0LHDV5qrw5P2gMEp4WE1SMHv1LHjoreo5X3hJXEHA5urb5 vFE8wvm+5nHG+0V3ToVs9/Kx8VYe02VmOnQgy5qvv/X0pFNAq9+V9GMLizP3RUbMvqmnM6WMRzo1Q nCyZjKoecoIY/pBrpxluQ24c7a8mtYO9z26x2OalaGmvn293i0dXayHOX85ZTsDfTjfBxo3cbiSJy N3d0AhMvAJU0R1gpAMplfMFLAcv+m1x674kfODt2TegElz7cPnaYX9VJXmvU+dJh8mngEbWSA5hMU USRUguOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYEbD-00000006SZa-27TV; Tue, 01 Dec 2026 03:32:11 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYEbC-00000006SZQ-0fKO; Tue, 01 Dec 2026 03:32:10 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id 39906611CF; Tue, 1 Dec 2026 03:32:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A1FD91F000C1; Tue, 1 Dec 2026 03:32:08 +0000 (UTC) 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== Date: Mon, 30 Nov 2026 21:32:06 -0600 From: Rob Herring To: netdev-bot+sashiko@kernel.org 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 Subject: Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports Message-ID: <20261201033206.GA4066057-robh@kernel.org> References: <20261122160907.200727-4-krzysztof.kozlowski@oss.qualcomm.com> <179545031306.3135.11482802242328622537@kernel.org> X-Archived-By: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <179545031306.3135.11482802242328622537@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-10.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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