Netdev List
 help / color / mirror / Atom feed
From: Nicolai Buchwitz <nb@tipi-net.de>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	davem@davemloft.net, Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com
Subject: Re: [PATCH net v3 3/4] net: phy: Clean the phy_ports after unregistering the downstream SFP bus
Date: Thu, 04 Jun 2026 12:14:32 +0200	[thread overview]
Message-ID: <4cafbb0aef07e1a41d3ee784062c7da6@tipi-net.de> (raw)
In-Reply-To: <20260604092819.723505-4-maxime.chevallier@bootlin.com>

HI Maxime

On 4.6.2026 11:28, Maxime Chevallier wrote:
> As reported by sashiko when looking a other patches, we need to ensure
> that the downstream SFP bus gets unregistered prior to destroying the
> phy_ports attached to a phy_device, as the SFP code may reference these
> ports. Let's make sure we follow that ordering in phy_remove().
> 
> Fixes: 589e934d2735 ("net: phy: Introduce PHY ports representation")
> Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> ---
>  drivers/net/phy/phy_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/phy/phy_device.c 
> b/drivers/net/phy/phy_device.c
> index 4ba880446896..b48722589f40 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -3806,11 +3806,11 @@ static int phy_remove(struct device *dev)
> 
>  	phydev->state = PHY_DOWN;
> 
> -	phy_cleanup_ports(phydev);
> -
>  	sfp_bus_del_upstream(phydev->sfp_bus);
>  	phydev->sfp_bus = NULL;
> 
> +	phy_cleanup_ports(phydev);
> +
>  	if (phydev->drv && phydev->drv->remove)
>  		phydev->drv->remove(phydev);

Reviewed-by: Nicolai Buchwitz <nb@tipi-net.de>

Thanks,
Nicolai

  reply	other threads:[~2026-06-04 10:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  9:28 [PATCH net v3 0/4] net: phy: some cleanups following phy_port SFP Maxime Chevallier
2026-06-04  9:28 ` [PATCH net v3 1/4] net: phy: clean the sfp upstream if phy probing fails Maxime Chevallier
2026-06-04  9:28 ` [PATCH net v3 2/4] net: phy: remove phy ports upon probe failure Maxime Chevallier
2026-06-04  9:28 ` [PATCH net v3 3/4] net: phy: Clean the phy_ports after unregistering the downstream SFP bus Maxime Chevallier
2026-06-04 10:14   ` Nicolai Buchwitz [this message]
2026-06-04  9:28 ` [PATCH net v3 4/4] net: phy: don't try to setup PHY-driven SFP cages when using genphy Maxime Chevallier
2026-06-09  1:50 ` [PATCH net v3 0/4] net: phy: some cleanups following phy_port SFP patchwork-bot+netdevbpf

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=4cafbb0aef07e1a41d3ee784062c7da6@tipi-net.de \
    --to=nb@tipi-net.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=thomas.petazzoni@bootlin.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