Re: [PATCH net v2] net: cpsw: fix netdev cleanup on probe failure
From: Karl Mehltretter
Date: Mon Oct 19 2026 - 16:37:29 EST
On Mon, Oct 19, 2026 at 12:19:11PM +0100, Siddharth Vadapalli wrote:
> > + unregister_netdev(ndev);
> > + disable_work_sync(&priv->rx_mode_work);
>
> Although the above code is a refactor, it appears to me that the correct
> sequence should be:
> disable_work_sync(&priv->rx_mode_work);
> unregister_netdev(ndev);
> RX Mode work (cpsw_ndo_set_rx_mode_work) does have a 'netif_running' check
> so it might still be fine if the sequence isn't followed.
>
> Please correct me if I am mistaken regarding the above. Rest of the patch
> looks good to me.
>
Both orders are safe here. The worker and unregister_netdev() serialize
on RTNL, so a worker running after unregister exits at !netif_running().
This matches cpsw_new, so I'd keep the current order.
Thanks,
Karl