From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: "Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Jose Abreu" <joabreu@synopsys.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
davem@davemloft.net, "Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexis Lothoré" <alexis.lothore@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/5] net: pcs: mtk-lynxi: fill in PCS supported_interfaces
Date: Thu, 2 Jan 2025 09:16:56 +0000 [thread overview]
Message-ID: <Z3ZZiCbQb3jFvZMv@shell.armlinux.org.uk> (raw)
In-Reply-To: <20241217141547.7748b3d3@fedora.home>
On Tue, Dec 17, 2024 at 02:15:47PM +0100, Maxime Chevallier wrote:
> Hi Russell,
>
> On Fri, 13 Dec 2024 19:35:01 +0000
> "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk> wrote:
>
> > Fill in the new PCS supported_interfaces member with the interfaces
> > that the Mediatek LynxI supports.
> >
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
> > ---
> > drivers/net/pcs/pcs-mtk-lynxi.c | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/net/pcs/pcs-mtk-lynxi.c b/drivers/net/pcs/pcs-mtk-lynxi.c
> > index 7de804535229..1377fb78eaa1 100644
> > --- a/drivers/net/pcs/pcs-mtk-lynxi.c
> > +++ b/drivers/net/pcs/pcs-mtk-lynxi.c
> > @@ -306,6 +306,11 @@ struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev,
> > mpcs->pcs.poll = true;
> > mpcs->interface = PHY_INTERFACE_MODE_NA;
> >
> > + __set_bit(PHY_INTERFACE_MODE_SGMII, mpcs->pcs.supported_interfaces);
> > + __set_bit(PHY_INTERFACE_MODE_QSGMII, mpcs->pcs.supported_interfaces);
>
> I'm sorry if I missed something, but I don't find where the QSGMII
> support comes from based on the current codebase :/
>
> I didn't spot that in the inband_caps commit, sorry :(
>
> > + __set_bit(PHY_INTERFACE_MODE_1000BASEX, mpcs->pcs.supported_interfaces);
> > + __set_bit(PHY_INTERFACE_MODE_2500BASEX, mpcs->pcs.supported_interfaces);
This list comes from the behaviour of the PCS as it stood before any of
these changes - the PCS code itself never validates the interface it's
passed, except for the call to
phylink_mii_c22_pcs_encode_advertisement() and checking that the
return value is non-negative. This is the only place that the
interfaces will be restricted - and they will be restricted to the
four interfaces I've listed above.
I don't have information on the hardware; so I can only go by the
behaviour of the existing code when making changes - and I take the
approach when adding new stuff of trying to avoid changing the code
behaviour, even if the existing code is doing something wrong.
I think, therefore, that a patch to remove stuff that isn't actually
supported should come after these patches, because that changes the
driver behaviour - otherwise the reason why QSGMII isn't included in
the patch would have needed to be described in each commit adding
extra code dealing with the interface mode.
It would've been nice had the driver implemented .pcs_validate() from
the start, which would've made it obvious which interface modes were
supported!
--
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:[~2025-01-02 9:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 9:05 [PATCH net-next 0/2] net: stmmac: dwmac-socfpga: Allow using 1000BaseX Maxime Chevallier
2024-12-13 9:05 ` [PATCH net-next 1/2] net: stmmac: dwmac-socfpga: Add support for 1000BaseX Maxime Chevallier
2024-12-13 9:05 ` [PATCH net-next 2/2] net: stmmac: dwmac-socfpga: Set interface modes from Lynx PCS as supported Maxime Chevallier
2024-12-13 12:22 ` Russell King (Oracle)
2024-12-13 17:29 ` Maxime Chevallier
2024-12-13 19:21 ` Russell King (Oracle)
2024-12-13 19:34 ` [PATCH net-next 1/5] net: phylink: add support for PCS supported_interfaces bitmap Russell King (Oracle)
2024-12-17 13:06 ` Maxime Chevallier
2024-12-13 19:34 ` [PATCH net-next 2/5] net: pcs: xpcs: fill in PCS supported_interfaces Russell King (Oracle)
2024-12-17 13:07 ` Maxime Chevallier
2024-12-13 19:35 ` [PATCH net-next 3/5] net: pcs: mtk-lynxi: " Russell King (Oracle)
2024-12-17 13:15 ` Maxime Chevallier
2025-01-02 9:16 ` Russell King (Oracle) [this message]
2024-12-13 19:35 ` [PATCH net-next 4/5] net: pcs: lynx: " Russell King (Oracle)
2024-12-17 13:18 ` Maxime Chevallier
2024-12-13 19:35 ` [PATCH net-next 5/5] net: stmmac: use " Russell King (Oracle)
2024-12-17 13:19 ` Maxime Chevallier
2025-01-02 9:08 ` Russell King (Oracle)
2024-12-16 8:42 ` [PATCH net-next 2/2] net: stmmac: dwmac-socfpga: Set interface modes from Lynx PCS as supported Maxime Chevallier
2024-12-17 1:33 ` Jakub Kicinski
2024-12-17 12:59 ` Maxime Chevallier
2024-12-17 14:49 ` Jakub Kicinski
2024-12-17 15:07 ` Maxime Chevallier
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=Z3ZZiCbQb3jFvZMv@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=alexandre.torgue@foss.st.com \
--cc=alexis.lothore@bootlin.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=joabreu@synopsys.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.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;
as well as URLs for NNTP newsgroup(s).