From: sashiko-bot@kernel.org
To: "Daniel Thompson" <daniel@riscstar.com>
Cc: bpf@vger.kernel.org, linux-sunxi@lists.linux.dev
Subject: Re: [PATCH net-next v3 1/2] net: stmmac: Introduce group arguments for enable/disable_dma_irq
Date: Fri, 16 Oct 2026 14:58:28 +0000 [thread overview]
Message-ID: <sashiko-outbox-174508@kernel.org> (raw)
In-Reply-To: <20261015-tc956x-stmmac-no_irq_teardown-v3-1-8189870be545@riscstar.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] net: stmmac: hardcoded generic OTHER masks break variant-specific IRQs
--
commit 6b53d33b472c115af2d55abc75c5663ee8048b05
Author: Daniel Thompson <daniel@riscstar.com>
net: stmmac: Introduce group arguments for enable/disable_dma_irq
The enable_dma_irq/disable_dma_irq functions take two booleans, rx and tx,
that identify which interrupts should be disabled. Replace these with a single
bitflag argument, group. This allows a third group to be added which is used to
enable/disable other sources of DMA interrupt.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
> index a0249715fafaf..7c5881ca61e8b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c
[ ... ]
> @@ -109,30 +109,39 @@ void dwmac4_set_rx_ring_len(struct stmmac_priv *priv, void __iomem *ioaddr,
> writel(len, ioaddr + DMA_CHAN_RX_RING_LEN(dwmac4_addrs, chan));
> }
>
> +static u32 dwmac4_enable_dma_mask(u32 group)
> +{
> + u32 mask = 0;
> +
> + if (group & STMMAC_DMA_IRQ_RX)
> + mask |= DMA_CHAN_INTR_ENA_RIE;
> + if (group & STMMAC_DMA_IRQ_TX)
> + mask |= DMA_CHAN_INTR_ENA_TIE;
> + if (group & STMMAC_DMA_IRQ_OTHER)
> + mask |= DMA_CHAN_INTR_DEFAULT_MASK &
> + ~(DMA_CHAN_INTR_ENA_RIE | DMA_CHAN_INTR_ENA_TIE);
> +
> + return mask;
> +}
[Severity: High]
Does hardcoding DMA_CHAN_INTR_DEFAULT_MASK here cause a regression for
hardware variants that require different bit layouts for summary and abnormal
interrupts?
For example, 4.10a uses a different mask DMA_CHAN_INTR_DEFAULT_MASK_4_10
during channel initialization, where AIE is BIT 14 rather than BIT 15. Since
the generic mask is used here, an attempt to disable STMMAC_DMA_IRQ_OTHER
interrupts could fail to clear the AIE bit on 4.10a hardware, potentially
causing an interrupt storm or use-after-free if unmasked interrupts fire
during XDP ring reconfiguration.
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> index a0383f9486c2d..d746527198546 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c
[ ... ]
> +static u32 dwmac_enable_dma_mask(u32 group)
> +{
> + u32 mask = 0;
> +
> + if (group & STMMAC_DMA_IRQ_RX)
> + mask |= DMA_INTR_DEFAULT_RX;
> + if (group & STMMAC_DMA_IRQ_TX)
> + mask |= DMA_INTR_DEFAULT_TX;
> + if (group & STMMAC_DMA_IRQ_OTHER)
> + mask |= DMA_INTR_DEFAULT_MASK &
> + ~(DMA_INTR_DEFAULT_RX | DMA_INTR_DEFAULT_TX);
[Severity: High]
Could this hardcoded mask also cause a regression for Loongson MACs?
Loongson hardware uses a custom mask layout DMA_INTR_DEFAULT_MASK_LOONGSON
because it has specific bits like NIS_TX (BIT 18) and NIS_RX (BIT 17). This
generic mask does not cover those bits, meaning they might remain enabled
when attempting to mask STMMAC_DMA_IRQ_OTHER interrupts.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015-tc956x-stmmac-no_irq_teardown-v3-0-8189870be545@riscstar.com?part=1
next prev parent reply other threads:[~2026-10-16 14:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 14:55 [PATCH net-next v3 0/2] net: stmmac: Avoid freeing and re-requesting IRQ during XDP set prog Daniel Thompson
2026-10-15 14:55 ` [PATCH net-next v3 1/2] net: stmmac: Introduce group arguments for enable/disable_dma_irq Daniel Thompson
2026-10-16 14:58 ` sashiko-bot [this message]
2026-10-15 14:55 ` [PATCH net-next v3 2/2] net: stmmac: Avoid freeing and re-requesting IRQ during XDP set prog Daniel Thompson
2026-10-16 14:58 ` sashiko-bot
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-174508@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@riscstar.com \
--cc=linux-sunxi@lists.linux.dev \
--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.