[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250704142138.3f1a4ec1@fedora.home>
Date: Fri, 4 Jul 2025 14:21:38 +0200
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Sarosh Hasan <quic_sarohasa@...cinc.com>
Cc: Wei Fang <wei.fang@....com>, "andrew @ lunn . ch" <andrew@...n.ch>,
Russell King <linux@...linux.org.uk>, Florian Fainelli
<f.fainelli@...il.com>, "hkallweit1 @ gmail . com" <hkallweit1@...il.com>,
"davem @ davemloft . net" <davem@...emloft.net>, "edumazet @ google . com"
<edumazet@...gle.com>, "kuba @ kernel . org" <kuba@...nel.org>, "pabeni @
redhat . com" <pabeni@...hat.com>, "xiaolei . wang @ windriver . com"
<xiaolei.wang@...driver.com>, "linux-kernel @ vger . kernel . org"
<linux-kernel@...r.kernel.org>, "imx @ lists . linux . dev"
<imx@...ts.linux.dev>, "netdev @ vger . kernel . org"
<netdev@...r.kernel.org>, Prasad Sodagudi <quic_psodagud@...cinc.com>,
Abhishek Chauhan <quic_abchauha@...cinc.com>, Sagar Cheluvegowda
<quic_scheluve@...cinc.com>, Girish Potnuru <quic_gpotnuru@...cinc.com>,
<kernel@....qualcomm.com>
Subject: Re: [PATCH net v1] net: phy: Change flag to autoremove the consumer
On Thu, 3 Jul 2025 14:30:41 +0530
Sarosh Hasan <quic_sarohasa@...cinc.com> wrote:
> phy_detach() is not called when the MDIO controller driver is
> removed. So phydev->devlink is not cleared, but actually the device
> link has been removed by phy_device_remove()--> device_del().Therefore,
> it will cause the crash when the MAC controller driver is removed.
> In such case delete link between phy dev and mac dev. Change the
> DL_FLAG_STATELESS flag to DL_FLAG_AUTOREMOVE_SUPPLIER,so that the
> consumer (MAC controller) driver will be automatically removed
> when the link is removed.
This doesn't work unfortunately, PHY devices can be hot-swappable, e.g.
when the PHY is in an SFP module. In that case, we must not
automatically remove the MAC controller driver when the PHY goes away.
I gave this patch a quick test on a Macchiatobin, which has an SFP
module, and indeed when you unplug the module while the link is up, the
system hangs completely when running a command like "ip a" afterwards.
Maxime
Powered by blists - more mailing lists