[PATCH net-next 2/2] net: stmmac: dwmac-sun8i: support ethtool rx-all

Andrew Lunn andrew at lunn.ch
Sun Nov 22 10:38:57 PST 2026


> +static void sun8i_dwmac_update_rx_ctl1(struct stmmac_priv *priv, u32 clear, u32 set)
>  {
> +	struct sunxi_priv_data *gmac = priv->plat->bsp_priv;
>  	u32 v;
>  
> -	v = readl(ioaddr + EMAC_RX_CTL1);
> -	v |= EMAC_RX_DMA_START;
> -	v |= EMAC_RX_DMA_EN;
> -	writel(v, ioaddr + EMAC_RX_CTL1);
> +	guard(spinlock_irqsave)(&gmac->rx_ctl1_lock);
> +	v = readl(priv->ioaddr + EMAC_RX_CTL1);
> +	writel((v & ~clear) | set, priv->ioaddr + EMAC_RX_CTL1);

Netdev does not like these magical guard constructs. scoped_guard is
acceptable, but good old fashioned lock/unlock is preferred.

It is also unclear why this now needs locks, when before it did not.

This patch is too big, does too many things. Please break it up into
smaller changes, with good commit messages, which are obviously
correct.

	Andrew



More information about the linux-arm-kernel mailing list