Re: [PATCH net v3 2/2] net: ethernet: ti: am65-cpsw: avoid devm_alloc_etherdev, fix module removal

From: Roger Quadros
Date: Mon Oct 07 2024 - 07:37:56 EST




On 04/10/2024 07:10, Nicolas Pitre wrote:
> From: Nicolas Pitre <npitre@xxxxxxxxxxxx>
>
> Usage of devm_alloc_etherdev_mqs() conflicts with
> am65_cpsw_nuss_cleanup_ndev() as the same struct net_device instances
> get unregistered twice. Switch to alloc_etherdev_mqs() and make sure
> am65_cpsw_nuss_cleanup_ndev() unregisters and frees those net_device
> instances properly.
>
> With this, it is finally possible to rmmod the driver without oopsing
> the kernel.
>
> Fixes: 93a76530316a ("net: ethernet: ti: introduce am65x/j721e gigabit eth subsystem driver")
> Signed-off-by: Nicolas Pitre <npitre@xxxxxxxxxxxx>

Reviewed-by: Roger Quadros <roger@xxxxxxxxxx>