[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch>
Date: Sun, 26 Nov 2023 18:13:55 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Claudiu Beznea <claudiu.beznea@...on.dev>
Cc: nicolas.ferre@...rochip.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
hkallweit1@...il.com, linux@...linux.org.uk, jgarzik@...ox.com,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] net: macb: Unregister nedev before MDIO bus in remove
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index cebae0f418f2..73d041af3de1 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -5165,11 +5165,11 @@ static void macb_remove(struct platform_device *pdev)
>
> if (dev) {
> bp = netdev_priv(dev);
> + unregister_netdev(dev);
> phy_exit(bp->sgmii_phy);
> mdiobus_unregister(bp->mii_bus);
> mdiobus_free(bp->mii_bus);
>
> - unregister_netdev(dev);
> tasklet_kill(&bp->hresp_err_tasklet);
I don't know this driver...
What does this tasklet do? Is it safe for it to run after the netdev
is unregistered, and the PHY and the mdio bus is gone? Maybe this
tasklet_kill should be after the interrupt is disabled, but before the
netdev is unregistered?
If you have one bug here, there might be others.
Andrew
Powered by blists - more mailing lists