Thread View: linux.kernel.netdev
7 messages
7 total messages
Started by Krzysztof Kozlowski
Sun, 22 Nov 2026 16:09
[PATCH net-next 1/2] dt-bindings: net: dsa: nxp,sja1105: Properly apply ports up to 11th port
Author: Krzysztof Kozlowski
Date: Sun, 22 Nov 2026 16:09
Date: Sun, 22 Nov 2026 16:09
32 lines
16857 bytes
16857 bytes
nxp,sja1110 devices have up to 11 ports in DTS (highest port@a), so the
pattern was missing applying schema to the last one. Fix this by
dropping the unit address from the pattern completely and adding proper
constrain on the 'reg' property, so child nodes beyond port@a will be
properly flagged as incorrect.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
index 0486489114cd..e9b53820cc36 100644
--- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml
@@ -89,7 +89,12 @@ patternProperties:
"^(ethernet-)?ports$":
additionalProperties: true
patternProperties:
- "^(ethernet-)?port@[0-9]$":
+ "^(ethernet-)?port@":
+ type: object
+ properties:
+ reg:
+ maximum: 10
+
allOf:
- if:
properties:
--
2.53.0
[PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports
Author: Krzysztof Kozlowski
Date: Sun, 22 Nov 2026 16:09
Date: Sun, 22 Nov 2026 16:09
166 lines
22216 bytes
22216 bytes
Bindings which reference dsa.yaml ports and restrict their own
ports to specific subset (e.g. with pattern "^(ethernet-)?port@[0-6]$")
actually silently allow ports with any unit address, because they use
"additionalProperties: true". These additional ports are incorrect and
should be flagged by the schema. Solve this by dropping the unit
address from the pattern completely and adding proper constrain on the
'reg' property.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
---
.../devicetree/bindings/net/dsa/lantiq,gswip.yaml | 4 +++-
.../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 9 +++++----
.../devicetree/bindings/net/dsa/microchip,ksz.yaml | 4 +++-
.../devicetree/bindings/net/dsa/microchip,lan937x.yaml | 7 ++++++-
.../bindings/net/dsa/microchip,lan96455s-switch.yaml | 6 +++++-
Documentation/devicetree/bindings/net/dsa/qca8k.yaml | 4 +++-
6 files changed, 25 insertions(+), 9 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
index 89f78a1bc113..83cdd6c80d09 100644
--- a/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/lantiq,gswip.yaml
@@ -108,13 +108,15 @@ patternProperties:
"^(ethernet-)?ports$":
type: object
patternProperties:
- "^(ethernet-)?port@[0-6]$":
+ "^(ethernet-)?port@":
$ref: dsa-port.yaml#
allOf:
- $ref: /schemas/phy/phy-common-props.yaml#
unevaluatedProperties: false
properties:
+ reg:
+ maximum: 6
maxlinear,slew-rate-txc:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1]
diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 90b3582b7619..80cda7ec5cb6 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -179,12 +179,13 @@ patternProperties:
additionalProperties: true
patternProperties:
- "^(ethernet-)?port@[0-6]$":
+ "^(ethernet-)?port@":
type: object
additionalProperties: true
properties:
reg:
+ maximum: 6
description:
Port address described must be 5 or 6 for CPU port and from 0 to 5
for user ports.
@@ -208,7 +209,7 @@ $defs:
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
- "^(ethernet-)?port@[0-6]$":
+ "^(ethernet-)?port@":
if:
required: [ ethernet ]
then:
@@ -220,7 +221,7 @@ $defs:
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
- "^(ethernet-)?port@[0-6]$":
+ "^(ethernet-)?port@":
if:
required: [ ethernet ]
then:
@@ -246,7 +247,7 @@ $defs:
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
- "^(ethernet-)?port@[0-6]$":
+ "^(ethernet-)?port@":
if:
required: [ ethernet ]
then:
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index 4ed13870ed3a..9cc14aa7b4b1 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -129,10 +129,12 @@ allOf:
patternProperties:
"^(ethernet-)?ports$":
patternProperties:
- "^(ethernet-)?port@[0-2]$":
+ "^(ethernet-)?port@":
$ref: dsa-port.yaml#
unevaluatedProperties: false
properties:
+ reg:
+ maximum: 2
microchip,rmii-clk-internal:
$ref: /schemas/types.yaml#/definitions/flag
description:
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
index 9973d64f15a7..36a7c81df747 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml
@@ -39,7 +39,12 @@ patternProperties:
"^(ethernet-)?ports$":
additionalProperties: true
patternProperties:
- "^(ethernet-)?port@[0-7]$":
+ "^(ethernet-)?port@":
+ type: object
+ properties:
+ reg:
+ maximum: 7
+
allOf:
- if:
properties:
diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml
index 517bc4c00de3..17e3c00f5a32 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan96455s-switch.yaml
@@ -105,11 +105,15 @@ properties:
type: object
additionalProperties: true
patternProperties:
- "^(ethernet-)?port@[0-8]$":
+ "^(ethernet-)?port@":
type: object
description: Ethernet switch ports
additionalProperties: true
+ properties:
+ reg:
+ maximum: 8
+
allOf:
- if:
properties:
diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml
index 167398ab253a..3840b336bdb9 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
qca,sgmii-rxclk-falling-edge:
$ref: /schemas/types.yaml#/definitions/flag
description:
--
2.53.0
Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports
Author: netdev-bot+sashiko
Date: Mon, 23 Nov 2026 16:11
Date: Mon, 23 Nov 2026 16:11
94 lines
11733 bytes
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
Re: [PATCH net-next 1/2] dt-bindings: net: dsa: nxp,sja1105: Properly apply ports up to 11th port
Author: "Rob Herring (Arm)"
Date: Tue, 01 Dec 2026 03:02
Date: Tue, 01 Dec 2026 03:02
16 lines
9232 bytes
9232 bytes
On Sun, 22 Nov 2026 17:09:08 +0100, Krzysztof Kozlowski wrote: > nxp,sja1110 devices have up to 11 ports in DTS (highest port@a), so the > pattern was missing applying schema to the last one. Fix this by > dropping the unit address from the pattern completely and adding proper > constrain on the 'reg' property, so child nodes beyond port@a will be > properly flagged as incorrect. > > Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> > --- > Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports
Author: Rob Herring
Date: Tue, 01 Dec 2026 03:32
Date: Tue, 01 Dec 2026 03:32
107 lines
12344 bytes
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
Re: [PATCH net-next 2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports
Author: Krzysztof Kozlowski
Date: Tue, 01 Dec 2026 04:23
Date: Tue, 01 Dec 2026 04:23
64 lines
17880 bytes
17880 bytes
On 23/11/2026 17:11, netdev-bot+sashiko@kernel.org wrote: >> >> $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: This is fixed by Lad's patch: https://lore.kernel.org/all/20261120002549.1908299-7-prabhakar.mahadev-lad.rj@bp.renesas.com/ > > 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? As Rob explained, that requires a bit more effort than this simple cleanup. Best regards, Krzysztof
Re: [PATCH net-next 1/2] dt-bindings: net: dsa: nxp,sja1105: Properly apply ports up to 11th port
Author: patchwork-bot+netdevbpf
Date: Tue, 01 Dec 2026 09:10
Date: Tue, 01 Dec 2026 09:10
27 lines
9396 bytes
9396 bytes
Hello:
This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Sun, 22 Nov 2026 17:09:08 +0100 you wrote:
> nxp,sja1110 devices have up to 11 ports in DTS (highest port@a), so the
> pattern was missing applying schema to the last one. Fix this by
> dropping the unit address from the pattern completely and adding proper
> constrain on the 'reg' property, so child nodes beyond port@a will be
> properly flagged as incorrect.
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
>
> [...]
Here is the summary with links:
- [net-next,1/2] dt-bindings: net: dsa: nxp,sja1105: Properly apply ports up to 11th port
https://git.kernel.org/netdev/net-next/c/82ad65aa0a66
- [net-next,2/2] dt-bindings: net: dsa: Flag unexpected ethernet ports
https://git.kernel.org/netdev/net-next/c/2164c096a98e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads