All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arthur Crepin Leblond" <arthur@marmottus.net>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH net-next v5 2/3] dt-bindings: net: wiznet,w5100: add link status interrupt
Date: Fri, 14 Aug 2026 08:58:49 +0000	[thread overview]
Message-ID: <20260814085850.4642D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260813-wiznet-link-gpio-v5-2-ac8046f24413@marmottus.net>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Removing the `interrupts` property from the top-level `properties` block without explicitly specifying `maxItems` in the conditional branches removes the upper bound on the array length, allowing invalid configurations to pass validation.
--

--- Patch [2]: [PATCH net-next v5 2/3] dt-bindings: net: wiznet,w5100: add link status interrupt ---
commit 27905addd6c59c9b61baecb1400ea1f5c8b0242f
Author: Arthur Crepin Leblond <arthur@marmottus.net>

dt-bindings: net: wiznet,w5100: add link status interrupt

Add an optional link status interrupt which can be connected to the
LINKLED pin on the device to detect link status changes.

> diff --git a/Documentation/devicetree/bindings/net/wiznet,w5100.yaml b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml
> index 217f301db182b..81f4382eb96c5 100644
> --- a/Documentation/devicetree/bindings/net/wiznet,w5100.yaml
> +++ b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml
> @@ -15,6 +15,33 @@ description: |
>  allOf:
>    - $ref: /schemas/net/ethernet-controller.yaml#
>    - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - wiznet,w5500
> +    then:
> +      properties:
> +        interrupts:
> +          minItems: 1
> +          items:
> +            - description: Main interrupt (INT pin on the device).
> +            - description:
> +                Optional interrupt for link status changes (LINKLED pin on
> +                w5500).

[Severity: Medium]
Does this leave the array length unbounded for the wiznet,w5500 conditional
block?

Because the items keyword in standard JSON Schema only applies constraints to
the specified indices without capping the array size, it appears maxItems: 2
is missing here. 

This could allow device tree configurations with 3 or more extraneous
interrupts elements to silently pass schema validation.

> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - wiznet,w5100
> +              - wiznet,w5200
> +    then:
> +      properties:
> +        interrupts:
> +          items:
> +            - description: Main interrupt (INT pin on the device).

[Severity: Medium]
Does this branch for wiznet,w5100 and wiznet,w5200 also require an explicit
maxItems: 1 constraint?

Without an explicit cap, invalid device tree configurations specifying 2 or
more interrupts for these devices could similarly go undetected.

>  properties:
>    compatible:
> @@ -23,10 +50,6 @@ properties:
>        - wiznet,w5200
>        - wiznet,w5500
>  
> -  interrupts:
> -    items:
> -      - description: Main interrupt (INT pin on the device).
> -

[Severity: Medium]
Does removing the interrupts property from this top-level properties block
prevent dt-schema from automatically inferring and injecting a maxItems
constraint?

Leaving maxItems unspecified in the allOf conditional branches while removing
it from the top-level block removes the upper bound on the array length,
allowing invalid hardware descriptions to go undetected during dtbs_check.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260813-wiznet-link-gpio-v5-0-ac8046f24413@marmottus.net?part=2

  parent reply	other threads:[~2026-08-14  8:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13  8:58 [PATCH net-next v5 0/3] w5100: restore GPIO-based link detection Arthur Crepin Leblond
2026-08-13  8:58 ` [PATCH net-next v5 1/3] dt-bindings: net: wiznet,w5100: convert to DT schema Arthur Crepin Leblond
2026-08-14  7:15   ` Krzysztof Kozlowski
2026-08-14 10:32     ` Arthur Crepin Leblond
2026-08-14  8:58   ` sashiko-bot
2026-08-13  8:58 ` [PATCH net-next v5 2/3] dt-bindings: net: wiznet,w5100: add link status interrupt Arthur Crepin Leblond
2026-08-14  7:17   ` Krzysztof Kozlowski
2026-08-14  8:58   ` sashiko-bot [this message]
2026-08-13  8:58 ` [PATCH net-next v5 3/3] w5100: detect carrier state using link status bit and optional interrupt Arthur Crepin Leblond
2026-08-14  8:58   ` sashiko-bot
2026-08-14 11:02   ` Arthur Crepin Leblond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260814085850.4642D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arthur@marmottus.net \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.