mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Richard Patel <ripatel@wii.dev>
Cc: intel-wired-lan@lists.osuosl.org,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Steve Douthit <stephend@silicom-usa.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH iwl-net v2] ixgbe: fix MDIO bus lifetime
Date: Tue, 8 Sep 2026 17:17:41 +0100	[thread overview]
Message-ID: <20260908161741.GB40544@horms.kernel.org> (raw)
In-Reply-To: <20260906023319.1978945-1-ripatel@wii.dev>

On Sun, Sep 06, 2026 at 02:33:19AM +0000, Richard Patel wrote:
> 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 <andrew@lunn.ch>
> Signed-off-by: Richard Patel <ripatel@wii.dev>
> ---
> v1 -> v2: use devm_mdiobus_register() instead of another
>           mdiobus_unregister() call
> v1: https://lore.kernel.org/netdev/20260826042945.2344686-1-ripatel@wii.dev/
> 
>  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(-)

Reviewed-by: Simon Horman <horms@kernel.org>


      parent reply	other threads:[~2026-09-08 16:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-06  2:33 Richard Patel
2026-09-08 13:15 ` Loktionov, Aleksandr
2026-09-08 16:17 ` Simon Horman [this message]

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=20260908161741.GB40544@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew@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=ripatel@wii.dev \
    --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

all inboxes | Powered by JetHome®