From: Jakub Kicinski <kuba@kernel.org>
To: jitendra.vegiraju@broadcom.com
Cc: Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, alexandre.torgue@foss.st.com,
davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
mcoquelin.stm32@gmail.com, bcm-kernel-feedback-list@broadcom.com,
richardcochran@gmail.com, ast@kernel.org, daniel@iogearbox.net,
hawk@kernel.org, john.fastabend@gmail.com,
rmk+kernel@armlinux.org.uk, rohan.g.thomas@altera.com,
linux-kernel@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org, bpf@vger.kernel.org,
andrew+netdev@lunn.ch, horms@kernel.org, sdf@fomichev.me,
me@ziyao.cc, siyanteng@cqsoftware.com.cn,
prabhakar.mahadev-lad.rj@bp.renesas.com,
weishangjuan@eswincomputing.com, wens@kernel.org,
vladimir.oltean@nxp.com, lizhi2@eswincomputing.com,
boon.khai.ng@altera.com, maxime.chevallier@bootlin.com,
chenchuangyu@xiaomi.com, yangtiezhu@loongson.cn,
ovidiu.panait.rb@renesas.com, chenhuacai@kernel.org,
florian.fainelli@broadcom.com, quic_abchauha@quicinc.com
Subject: Re: [PATCH net-next v9 1/4] net: stmmac: Add DW25GMAC support in stmmac core driver
Date: Mon, 6 Apr 2026 19:09:54 -0700 [thread overview]
Message-ID: <20260407020954.3674529-1-kuba@kernel.org> (raw)
In-Reply-To: <20260402213629.1996133-2-jitendra.vegiraju@broadcom.com>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
Subject: net: stmmac: Add DW25GMAC support in stmmac core driver
This commit introduces support for the DW25GMAC hardware in the stmmac
core driver, which uses a new Hyper-DMA (HDMA) architecture. It adds a
new DMA ops instance mapping virtual DMA channels to physical DMA
channels and sets up the basic device configurations.
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dw25gmac.c b/drivers/net/ethernet/stmicro/stmmac/dw25gmac.c
> new file mode 100644
> index 0000000000000..82eb22bff73e0
> --- /dev/null
> +++ b/drivers/net/ethernet/stmicro/stmmac/dw25gmac.c
[ ... ]
> +static int rd_dma_ch_ind(void __iomem *ioaddr, u8 mode, u32 channel)
> +{
> + u32 reg_val = 0;
> +
> + reg_val |= FIELD_PREP(XXVGMAC_MODE_SELECT, mode);
> + reg_val |= FIELD_PREP(XXVGMAC_ADDR_OFFSET, channel);
> + reg_val |= XXVGMAC_CMD_TYPE | XXVGMAC_OB;
> + writel(reg_val, ioaddr + XXVGMAC_DMA_CH_IND_CONTROL);
> + return readl(ioaddr + XXVGMAC_DMA_CH_IND_DATA);
> +}
Does this readl() need to wait for the hardware to clear the XXVGMAC_OB
(Operation Busy) bit? Returning immediately might read uninitialized or
stale data if the hardware hasn't finished the fetch.
> +
> +static void wr_dma_ch_ind(void __iomem *ioaddr, u8 mode, u32 channel, u32 val)
> +{
> + u32 reg_val = 0;
> +
> + writel(val, ioaddr + XXVGMAC_DMA_CH_IND_DATA);
> + reg_val |= FIELD_PREP(XXVGMAC_MODE_SELECT, mode);
> + reg_val |= FIELD_PREP(XXVGMAC_ADDR_OFFSET, channel);
> + reg_val |= XGMAC_OB;
This isn't a bug, but should this use the XXVGMAC_OB macro instead of
XGMAC_OB here for consistency?
> + writel(reg_val, ioaddr + XXVGMAC_DMA_CH_IND_CONTROL);
> +}
Similarly, does this function need to poll for the busy bit to clear after
the writel()? If back-to-back operations occur, the next indirect write
might overwrite the control and data registers while the hardware is still
processing this request.
[ ... ]
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> index f02b434bbd505..64c38de294da2 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
[ ... ]
> -int dwxgmac2_setup(struct stmmac_priv *priv)
> +static void dwxgmac2_common_setup(struct stmmac_priv *priv, char *mac_name)
> {
This isn't a bug, but should mac_name be declared as const char * since it
is passed string literals like "XGMAC2" and "DW25GMAC"? This avoids
discarded-qualifiers compiler warnings.
> struct mac_device_info *mac = priv->hw;
>
> - dev_info(priv->device, "\tXGMAC2\n");
> + dev_info(priv->device, "\t%s\n", mac_name);
[ ... ]
--
pw-bot: cr
next prev parent reply other threads:[~2026-04-07 2:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 21:36 [PATCH net-next v9 0/4] net: stmmac: Add PCI driver support for BCM8958x Jitendra Vegiraju
2026-04-02 21:36 ` [PATCH net-next v9 1/4] net: stmmac: Add DW25GMAC support in stmmac core driver Jitendra Vegiraju
2026-04-07 2:09 ` Jakub Kicinski [this message]
2026-04-09 22:14 ` Jitendra Vegiraju
2026-04-07 14:09 ` Russell King (Oracle)
2026-04-07 15:42 ` Russell King (Oracle)
2026-04-02 21:36 ` [PATCH net-next v9 2/4] net: stmmac: Integrate dw25gmac into hwif handling Jitendra Vegiraju
2026-04-07 2:09 ` Jakub Kicinski
2026-04-02 21:36 ` [PATCH net-next v9 3/4] net: stmmac: Add PCI glue driver for BCM8958x Jitendra Vegiraju
2026-04-07 2:10 ` Jakub Kicinski
2026-04-02 21:36 ` [PATCH net-next v9 4/4] net: stmmac: Add BCM8958x driver to build system Jitendra Vegiraju
2026-04-07 2:08 ` Jakub Kicinski
2026-04-07 2:10 ` Jakub Kicinski
2026-04-07 7:24 ` [PATCH net-next v9 0/4] net: stmmac: Add PCI driver support for BCM8958x Russell King (Oracle)
2026-04-09 22:08 ` Jitendra Vegiraju
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=20260407020954.3674529-1-kuba@kernel.org \
--to=kuba@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=ast@kernel.org \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=boon.khai.ng@altera.com \
--cc=bpf@vger.kernel.org \
--cc=chenchuangyu@xiaomi.com \
--cc=chenhuacai@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=jitendra.vegiraju@broadcom.com \
--cc=john.fastabend@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=lizhi2@eswincomputing.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=me@ziyao.cc \
--cc=netdev@vger.kernel.org \
--cc=ovidiu.panait.rb@renesas.com \
--cc=pabeni@redhat.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=quic_abchauha@quicinc.com \
--cc=richardcochran@gmail.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=rohan.g.thomas@altera.com \
--cc=sdf@fomichev.me \
--cc=siyanteng@cqsoftware.com.cn \
--cc=vladimir.oltean@nxp.com \
--cc=weishangjuan@eswincomputing.com \
--cc=wens@kernel.org \
--cc=yangtiezhu@loongson.cn \
/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.