From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>, Heiner Kallweit <hkallweit1@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next 3/3] net: phylink: simplify how SFP PHYs are attached
Date: Tue, 22 Oct 2024 12:58:05 +0100 [thread overview]
Message-ID: <ZxeTTTrU7VyUxYwk@shell.armlinux.org.uk> (raw)
In-Reply-To: <E1t3DSr-000Vxg-Qx@rmk-PC.armlinux.org.uk>
On Tue, Oct 22, 2024 at 12:54:17PM +0100, Russell King (Oracle) wrote:
> There are a few issues with how SFP PHYs are attached:
>
> a) The phylink_sfp_connect_phy() and phylink_sfp_config_phy() code
> validates the configuration three times:
>
> 1. To discover the support/advertising masks that the PHY/PCS/MAC
> can support in order to select an interface.
> 2. To validate the selected interface.
> 3. When the PHY is brought up after being attached, another validation
> is done.
>
> This is needlessly complex.
>
> b) The configuration is set prior to the PHY being attached, which
> means we don't have the PHY available in phylink_major_config()
> for phylink_pcs_neg_mode() to make decisions upon.
>
> We have already added an extra step to validate the selected interface,
> so we can now move the attachment and bringup of the PHY earlier,
> inside phylink_sfp_config_phy(). This results in the validation at
> step 2 above becoming entirely unnecessary, so remove that too.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
There's a build warning in this patch, which I'll address - but please
let me have any comments in the mean time.
> static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
> {
> struct phylink *pl = upstream;
> - phy_interface_t interface;
> u8 mode;
> int ret;
"ret" needs to be removed.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
next prev parent reply other threads:[~2024-10-22 11:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 11:39 [PATCH net-next 0/3] net: phylink: simplify SFP PHY attachment Russell King (Oracle)
2024-10-22 11:54 ` [PATCH net-next 1/3] net: phylink: add common validation for sfp_select_interface() Russell King (Oracle)
2024-10-22 13:47 ` Maxime Chevallier
2024-10-22 11:54 ` [PATCH net-next 2/3] net: phylink: validate sfp_select_interface() returned interface Russell King (Oracle)
2024-10-22 13:47 ` Maxime Chevallier
2024-10-22 11:54 ` [PATCH net-next 3/3] net: phylink: simplify how SFP PHYs are attached Russell King (Oracle)
2024-10-22 11:58 ` Russell King (Oracle) [this message]
2024-10-22 13:49 ` Maxime Chevallier
2024-10-23 13:11 ` kernel test robot
2024-10-22 11:54 ` [PATCH net-next 0/3] net: phylink: simplify SFP PHY attachment Maxime Chevallier
2024-10-22 11:59 ` Russell King (Oracle)
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=ZxeTTTrU7VyUxYwk@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.