Re: [PATCH] net: stmmac: enable MAC rx/tx after DMA start
From: Andrew Lunn
Date: Sun Jul 26 2026 - 14:16:03 EST
> @@ -3692,9 +3692,6 @@ static int stmmac_hw_setup(struct net_device *dev)
> priv->hw->rx_csum = 0;
> }
>
> - /* Enable the MAC Rx/Tx */
> - stmmac_mac_set(priv, priv->ioaddr, true);
> -
> /* Set the HW DMA mode and the COE */
> stmmac_dma_operation_mode(priv);
>
> @@ -3750,6 +3747,9 @@ static int stmmac_hw_setup(struct net_device *dev)
> /* Start the ball rolling... */
> stmmac_start_all_dma(priv);
>
> + /* Enable the MAC Rx/Tx */
> + stmmac_mac_set(priv, priv->ioaddr, true);
> +
There should be a function which is the opposite of stmmac_hw_setup(),
which tears it down. What order are things done there? tear down is
generally done in the opposite order to setup, so does the "Disable
the MAC Rx/Tx" also need to move?
> @@ -7189,12 +7189,12 @@ int stmmac_xdp_open(struct net_device *dev)
> hrtimer_setup(&tx_q->txtimer, stmmac_tx_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> }
>
> - /* Enable the MAC Rx/Tx */
> - stmmac_mac_set(priv, priv->ioaddr, true);
> -
> /* Start Rx & Tx DMA Channels */
> stmmac_start_all_dma(priv);
>
> + /* Enable the MAC Rx/Tx */
> + stmmac_mac_set(priv, priv->ioaddr, true);
> +
> ret = stmmac_request_irq(dev);
> if (ret)
> goto irq_error;
Same comment for the opposite of stmmac_xdp_open().
Andrew