* [PATCH net] net: emac: release DT PHY resources on teardown
@ 2026-10-20 22:30 Rosen Penev
2026-10-20 22:33 ` netdev-bot+sinfo
0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2026-10-20 22:30 UTC (permalink / raw)
To: netdev
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Christian Lamparter, open list
Disconnect PHYLIB PHYs and deregister fixed PHYs during both probe
unwind and driver removal. Without this cleanup, unbinding a DT-based
EMAC can leave its PHY attached to the freed netdev, while fixed-link
instances retain their registered fixed PHY.
Fixes: a577ca6badb5 ("net: emac: add support for device-tree based PHY discovery and setup")
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/net/ethernet/ibm/emac/core.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index e7043523457c..4124a90b18c4 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -2810,6 +2810,16 @@ static int emac_init_phy(struct emac_instance *dev)
return 0;
}
+static void emac_cleanup_phy(struct emac_instance *dev)
+{
+ struct device_node *np = dev->ofdev->dev.of_node;
+
+ if (dev->ndev->phydev && dev->phy.address >= 0)
+ phy_disconnect(dev->ndev->phydev);
+ if (of_phy_is_fixed_link(np))
+ of_phy_deregister_fixed_link(np);
+}
+
static int emac_init_config(struct emac_instance *dev)
{
struct device_node *np = dev->ofdev->dev.of_node;
@@ -3197,6 +3207,7 @@ static int emac_probe(struct platform_device *ofdev)
if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII))
zmii_detach(dev->zmii_dev, dev->zmii_port);
err_unreg_commac:
+ emac_cleanup_phy(dev);
mal_unregister_commac(dev->mal, &dev->commac);
err_rel_deps:
emac_put_deps(dev);
@@ -3220,6 +3231,7 @@ static void emac_remove(struct platform_device *ofdev)
unregister_netdev(dev->ndev);
cancel_work_sync(&dev->reset_work);
+ emac_cleanup_phy(dev);
if (emac_has_feature(dev, EMAC_FTR_HAS_TAH))
tah_detach(dev->tah_dev, dev->tah_port);
--
2.56.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: emac: release DT PHY resources on teardown
2026-10-20 22:30 [PATCH net] net: emac: release DT PHY resources on teardown Rosen Penev
@ 2026-10-20 22:33 ` netdev-bot+sinfo
2026-10-20 22:37 ` Rosen Penev
0 siblings, 1 reply; 3+ messages in thread
From: netdev-bot+sinfo @ 2026-10-20 22:33 UTC (permalink / raw)
To: Rosen Penev
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Christian Lamparter, linux-kernel
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: emac: release DT PHY resources on teardown
2026-10-20 22:33 ` netdev-bot+sinfo
@ 2026-10-20 22:37 ` Rosen Penev
0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-10-20 22:37 UTC (permalink / raw)
To: netdev-bot+sinfo
Cc: netdev, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, Christian Lamparter, linux-kernel
On Tue, Oct 20, 2026 at 3:33 PM <netdev-bot+sinfo@kernel.org> wrote:
>
> Hi!
>
> This is an automated message. This series looks like a fix, but its
> commit messages seem to be missing some information:
>
> - How the issue was discovered, e.g. hit in production, hit during
> development, syzbot report, manual code inspection, LLM or static
> analysis tool scan.
LLM
>
> - Whether the issue was actually triggered, or is only theoretical
> (e.g. found by code inspection). If it was triggered please include
> the symptoms, like the stack trace or error messages.
>
> - What hardware the change was tested on. For driver fixes please
> mention the device (and if relevant firmware version) used for
> testing, or say that the change was not tested on real hardware.
>
> Please do not repost the series just to address the above. Instead,
> reply to this email with the missing information, so that reviewers
> can take it into account. If the series needs another revision for
> other reasons, please include the information in the commit messages
> then.
>
> The evaluation is done by an LLM so it may be wrong, if you think
> that is the case please reply and explain.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-10-20 22:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-20 22:30 [PATCH net] net: emac: release DT PHY resources on teardown Rosen Penev
2026-10-20 22:33 ` netdev-bot+sinfo
2026-10-20 22:37 ` Rosen Penev
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®