From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Sarosh Hasan <quic_sarohasa@quicinc.com>
Cc: Wei Fang <wei.fang@nxp.com>,
"andrew @ lunn . ch" <andrew@lunn.ch>,
Russell King <linux@armlinux.org.uk>,
Florian Fainelli <f.fainelli@gmail.com>,
"hkallweit1 @ gmail . com" <hkallweit1@gmail.com>,
"davem @ davemloft . net" <davem@davemloft.net>,
"edumazet @ google . com" <edumazet@google.com>,
"kuba @ kernel . org" <kuba@kernel.org>,
"pabeni @ redhat . com" <pabeni@redhat.com>,
"xiaolei . wang @ windriver . com" <xiaolei.wang@windriver.com>,
"linux-kernel @ vger . kernel . org"
<linux-kernel@vger.kernel.org>,
"imx @ lists . linux . dev" <imx@lists.linux.dev>,
"netdev @ vger . kernel . org" <netdev@vger.kernel.org>,
Prasad Sodagudi <quic_psodagud@quicinc.com>,
Abhishek Chauhan <quic_abchauha@quicinc.com>,
Sagar Cheluvegowda <quic_scheluve@quicinc.com>,
Girish Potnuru <quic_gpotnuru@quicinc.com>,
<kernel@oss.qualcomm.com>
Subject: Re: [PATCH net v1] net: phy: Change flag to autoremove the consumer
Date: Fri, 4 Jul 2025 14:21:38 +0200 [thread overview]
Message-ID: <20250704142138.3f1a4ec1@fedora.home> (raw)
In-Reply-To: <20250703090041.23137-1-quic_sarohasa@quicinc.com>
On Thu, 3 Jul 2025 14:30:41 +0530
Sarosh Hasan <quic_sarohasa@quicinc.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
next prev parent reply other threads:[~2025-07-04 12:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-03 9:00 [PATCH net v1] net: phy: Change flag to autoremove the consumer Sarosh Hasan
2025-07-04 12:21 ` Maxime Chevallier [this message]
2025-07-07 6:03 ` Wei Fang
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=20250704142138.3f1a4ec1@fedora.home \
--to=maxime.chevallier@bootlin.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@oss.qualcomm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quic_abchauha@quicinc.com \
--cc=quic_gpotnuru@quicinc.com \
--cc=quic_psodagud@quicinc.com \
--cc=quic_sarohasa@quicinc.com \
--cc=quic_scheluve@quicinc.com \
--cc=wei.fang@nxp.com \
--cc=xiaolei.wang@windriver.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