Re: [PATCH net v2 3/3] net: phy: don't try to setup PHY-driven SFP cages when using genphy
From: Jakub Kicinski
Date: Wed Jun 03 2026 - 22:29:14 EST
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
net: phy: don't try to setup PHY-driven SFP cages when using genphy
This change skips phy_sfp_probe() when the genphy driver is bound,
avoiding an RTNL deadlock in sfp_bus_add_upstream() since genphy
binding runs under RTNL while non-genphy driver binding does not.
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index a171cbe2a74a..8eace58e9f12 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -3512,9 +3512,14 @@ static int phy_setup_ports(struct phy_device *phydev)
> if (ret)
> return ret;
>
> - ret = phy_sfp_probe(phydev);
> - if (ret)
> - goto out;
> + /* We don't support SFP with genphy drivers. Also, genphy driver binding
> + * occurs with RTNL help, wich will deadlock the sfp_bus_add_upstream().
^^^^
[Low]
There is a typo in the new comment, "wich" should be "which".
> + */
> + if (!phydev->is_genphy_driven) {
> + ret = phy_sfp_probe(phydev);
> + if (ret)
> + goto out;
> + }
>
> if (phydev->n_ports < phydev->max_n_ports) {
> ret = phy_default_setup_single_port(phydev);