From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Claudiu Beznea <claudiu.beznea@tuxon.dev>,
nicolas.ferre@microchip.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
hkallweit1@gmail.com, jgarzik@pobox.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: macb: Unregister nedev before MDIO bus in remove
Date: Sun, 26 Nov 2023 17:49:38 +0000 [thread overview]
Message-ID: <ZWOFMof7YMqGVl6f@shell.armlinux.org.uk> (raw)
In-Reply-To: <086fc661-0974-4bb6-a8ae-daa9d53361d9@lunn.ch>
On Sun, Nov 26, 2023 at 06:13:55PM +0100, Andrew Lunn wrote:
> > 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?
.. and while evaluating Andrew's comment, check whether the tasklet
is necessary for the device to successfully close or not - remembering
that unregister_netdev() will close down an open netdev.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2023-11-26 17:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-26 14:10 [PATCH 0/2] net: macb: Fixes for macb driver Claudiu Beznea
2023-11-26 14:10 ` [PATCH 1/2] net: phy: Check phydev->drv before dereferencing it Claudiu Beznea
2023-11-26 15:53 ` Russell King (Oracle)
2023-11-26 14:10 ` [PATCH 2/2] net: macb: Unregister nedev before MDIO bus in remove Claudiu Beznea
2023-11-26 15:51 ` Russell King (Oracle)
2023-11-26 17:13 ` Andrew Lunn
2023-11-26 17:49 ` Russell King (Oracle) [this message]
2023-11-27 6:11 ` claudiu beznea
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZWOFMof7YMqGVl6f@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=claudiu.beznea@tuxon.dev \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=jgarzik@pobox.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).