> -----Original Message-----
> From: Richard Patel <[email protected]> 
> Sent: Saturday, September 5, 2026 7:33 PM
> To: [email protected]
> Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw 
> <[email protected]>; Andrew Lunn <[email protected]>; Steve Douthit 
> <[email protected]>; [email protected]; 
> [email protected]; > Richard Patel <[email protected]>
> Subject: [PATCH iwl-net v2] ixgbe: fix MDIO bus lifetime
>
> 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'
>
> Switch to devm_mdiobus_register(), drop custom unregister calls.
> This is safe because the bus is already devm-allocated, so unregister
> always happens before free.
>
> Assisted-by: LLM
> Fixes: 8fa10ef01260 ("ixgbe: register a mdiobus")
> Suggested-by: Andrew Lunn <[email protected]>
> Signed-off-by: Richard Patel <[email protected]>
> ---
> v1 -> v2: use devm_mdiobus_register() instead of another
>           mdiobus_unregister() call
> v1: https://lore.kernel.org/netdev/[email protected]/
>
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 9 ++-------
>  drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  | 2 +-
>  2 files changed, 3 insertions(+), 8 deletions(-)

Tested-by: Sunitha Mekala <[email protected]> (A Contingent worker at 
Intel)

Reply via email to