From: Richard Patel <ripatel@wii.dev>
To: intel-wired-lan@lists.osuosl.org
Cc: Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
Steve Douthit <stephend@silicom-usa.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Richard Patel <ripatel@wii.dev>
Subject: [PATCH] ixgbe: fix MDIO bus leak when rejecting SFP module
Date: Wed, 26 Aug 2026 04:29:45 +0000 [thread overview]
Message-ID: <20260826042945.2344686-1-ripatel@wii.dev> (raw)
Plugging in an unsupported SFP module caused ixgbe NICs to get
wedged permanently.
ixgbe unregisters the netdev when rejecting an SFP transceiver as
unsupported.
ixgbe 0000:3b:00.0: failed to initialize because an unsupported SFP+ module type was detected.
ixgbe 0000:3b:00.0: Reload the driver after installing a supported module.
ixgbe 0000:3b:00.0: removed PHC on enp59s0
This code path failed to unregister an MDIO bus owned by that
netdev, so when unregister_netdev() tries to tear it down
(via device_del() -> devres_release_all() -> mdiobus_free()),
it trips over the leaked registration.
ixgbe-mdio-0000:3b:00.0: not in UNREGISTERED state
WARNING: drivers/net/phy/mdio_bus_provider.c:711 at mdiobus_free+0x3d/0x50, CPU#21: kworker/u128:0/12
This prevents ixgbe from reloading, even after PCIe remove/rescan:
sysfs: cannot create duplicate filename '/class/mdio_bus/ixgbe-mdio-0000:3b:00.0'
Call mdiobus_unregister() before unregistering the netdev,
like ixgbe_service_task() does after a firmware error.
Fixes: 8fa10ef01260 ("ixgbe: register a mdiobus")
Signed-off-by: Richard Patel <ripatel@wii.dev>
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f91856498eb2..fca57749218b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8470,6 +8470,10 @@ static void ixgbe_sfp_detection_subtask(struct ixgbe_adapter *adapter)
"SFP+ module type was detected.\n");
e_dev_err("Reload the driver after installing a "
"supported module.\n");
+ if (adapter->mii_bus) {
+ mdiobus_unregister(adapter->mii_bus);
+ adapter->mii_bus = NULL;
+ }
unregister_netdev(adapter->netdev);
}
}
--
2.52.0
next reply other threads:[~2026-08-26 4:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-26 4:29 Richard Patel [this message]
2026-08-26 12:23 ` [PATCH] ixgbe: fix MDIO bus leak when rejecting SFP module Andrew Lunn
2026-08-26 18:27 ` Richard Patel
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=20260826042945.2344686-1-ripatel@wii.dev \
--to=ripatel@wii.dev \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
--cc=stephend@silicom-usa.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