Re: [PATCH net v4 07/10] net: au1000: restore RX buffer addresses when restarting the MAC
From: netdev-bot+sashiko
Date: Tue Nov 24 2026 - 20:28:39 EST
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] In `au1000_init()`
(drivers/net/ethernet/amd/au1000_eth.c:727-728), the patch writes the…
--
net: au1000: restore RX buffer addresses when restarting the MAC
The commit changes au1000_init() to reload each RX descriptor's buffer
address from rx_db_inuse[] before setting RX_DMA_ENABLE. Before this,
it only OR-ed in the enable bit on whatever address the DMA engine had
left behind. That could make a receive after close/reopen start partway
into its buffer.
> diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
> index ea2766343d518..ec28ed33bf698 100644
> --- a/drivers/net/ethernet/amd/au1000_eth.c
> +++ b/drivers/net/ethernet/amd/au1000_eth.c
> @@ -724,7 +724,8 @@ static int au1000_init(struct net_device *dev)
>
>
> for (i = 0; i < NUM_RX_DMA; i++)
> - aup->rx_dma_ring[i]->buff_stat |= RX_DMA_ENABLE;
> + writel(lower_32_bits(aup->rx_db_inuse[i]->dma_addr) |
> + RX_DMA_ENABLE, &aup->rx_dma_ring[i]->buff_stat);
[Severity: Low]
This isn't a bug, but should this be a plain store, like the other
accesses to buff_stat?
The commit message says this matches the receive completion path.
That path does a plain C assignment, not a writel():
drivers/net/ethernet/amd/au1000_eth.c:au1000_rx() {
...
prxd->buff_stat = lower_32_bits(pDB->dma_addr) | RX_DMA_ENABLE;
...
}
au1000_probe() initializes the same field the same way:
aup->rx_dma_ring[i]->buff_stat = lower_32_bits(pDB->dma_addr);
au1000_reset_mac_unlocked() and the reads in au1000_init() and
au1000_rx() also use plain loads and stores.
In au1000_eth.h, rx_dma_ring is declared without __iomem:
struct rx_dma *rx_dma_ring[NUM_RX_DMA];
Passing &aup->rx_dma_ring[i]->buff_stat to writel() therefore gives a
sparse different-address-space warning. It also means this one
register is now accessed in two different styles.
The driver already passes non-__iomem pointers to writel() for
aup->mac and aup->enable. What this patch adds is the mixed accessor
style on buff_stat.
There's no runtime difference. MIPS_AU1X00_ENET depends on
MIPS_ALCHEMY, which only supports little-endian, so writel() and the
plain store write the same bits.
Would a plain store match the surrounding code better, like this:
aup->rx_dma_ring[i]->buff_stat =
lower_32_bits(aup->rx_db_inuse[i]->dma_addr) | RX_DMA_ENABLE;
The other option is to mark rx_dma_ring and tx_dma_ring as __iomem
and convert every access to readl()/writel().
>
> wmb(); /* drain writebuffer */
>
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261121004809.1690280-1-f.fainelli%40gmail.com