Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Chris Scott" <gilroyscott1970@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [RFC net-next 1/3] dt-bindings: net: airoha: npu: add DMA pool memory region
Date: Sun, 25 Oct 2026 15:42:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-184260@kernel.org> (raw)
In-Reply-To: <20261024154150.45733-2-gilroyscott1970@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: net: airoha: memory-region schema rejects dma without ba
--

commit cc6f0348f0ae07c584596be380fd6f15cd65362e
Author: Daniel Pawlik <pawlik.dan@gmail.com>

dt-bindings: net: airoha: npu: add DMA pool memory region

This commit updates the Airoha EN7581 NPU device tree binding to allow an
optional coherent DMA pool memory region after either the firmware region
or the WLAN offload regions.

Link: https://lore.kernel.org/r/atCRsquzA1UxSpCc@mediatek.com

> diff --git a/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml b/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml
> index aefa19c5b4246..21a1a275003b1 100644
> --- a/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml
> +++ b/Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml
> @@ -42,22 +42,34 @@ properties:
>        - description: wlan irq line5
>  
>    memory-region:
> -    items:
> -      - description: NPU firmware binary region
> -      - description: NPU wlan offload RX buffers region
> -      - description: NPU wlan offload TX buffers region
> -      - description: NPU wlan offload TX packet identifiers region
> -      - description: NPU wlan Block Ack buffers region
> -    minItems: 1
> +    oneOf:
> +      - items:
> +          - description: NPU firmware binary region
> +          - description: Coherent DMA pool for buffers shared with the NPU
> +        minItems: 1
> +      - items:
> +          - description: NPU firmware binary region
> +          - description: NPU wlan offload RX buffers region
> +          - description: NPU wlan offload TX buffers region
> +          - description: NPU wlan offload TX packet identifiers region
> +          - description: NPU wlan Block Ack buffers region
> +          - description: Coherent DMA pool for buffers shared with the NPU
> +        minItems: 4
>  
>    memory-region-names:
> -    items:
> -      - const: firmware
> -      - const: pkt
> -      - const: tx-pkt
> -      - const: tx-bufid
> -      - const: ba
> -    minItems: 1
> +    oneOf:
> +      - items:
> +          - const: firmware
> +          - const: dma
> +        minItems: 1
> +      - items:
> +          - const: firmware
> +          - const: pkt
> +          - const: tx-pkt
> +          - const: tx-bufid
> +          - const: ba
> +          - const: dma
> +        minItems: 4

[Severity: Medium]
Does this schema in Documentation/devicetree/bindings/net/airoha,en7581-npu.yaml
under properties:memory-region and properties:memory-region-names reject valid
device trees that configure WLAN offload with the dma pool when the optional
ba region is omitted?

In drivers/net/ethernet/airoha/airoha_npu.c, airoha_npu_wlan_init_memory()
treats the ba region as optional while requiring tx-bufid, pkt, and tx-pkt:

drivers/net/ethernet/airoha/airoha_npu.c:airoha_npu_wlan_init_memory() {
	...
	if (of_property_match_string(npu->dev->of_node, "memory-region-names",
				     "ba") >= 0) {
		cmd = WLAN_FUNC_SET_WAIT_DRAM_BA_NODE_ADDR;
		err = airoha_npu_wlan_set_reserved_memory(npu, 0, "ba", cmd);
		if (err)
			return err;
	}
	...
}

Because the second oneOf branch validates items positionally with minItems: 4,
a 5-entry list that omits ba and appends dma (firmware, pkt, tx-pkt, tx-bufid,
dma) is checked against the fifth item (const: ba) and fails schema validation.

Should the fifth item in the WLAN oneOf branch allow either ba or dma when
only 5 regions are present?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261024154150.45733-1-gilroyscott1970@gmail.com?part=1

  reply	other threads:[~2026-10-25 15:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24 15:41 [RFC net-next 0/3] net: airoha: npu: keep NPU-shared DMA buffers in the NPU window Chris Scott
2026-10-24 15:41 ` [RFC net-next 1/3] dt-bindings: net: airoha: npu: add DMA pool memory region Chris Scott
2026-10-25 15:42   ` sashiko-bot [this message]
2026-10-24 15:41 ` [RFC net-next 2/3] net: airoha: npu: attach a coherent pool in the NPU window Chris Scott
2026-10-26  7:48   ` Lorenzo Bianconi
2026-10-27  5:10     ` Chris Scott
2026-10-24 15:41 ` [RFC net-next 3/3] net: airoha: npu: use coherent memory for mailbox messages Chris Scott
2026-10-26  7:50   ` Lorenzo Bianconi

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=sashiko-outbox-184260@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gilroyscott1970@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox