From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrew Halaney <ahalaney@redhat.com>
Cc: Serge Semin <fancer.lancer@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
Alexei Starovoitov <ast@kernel.org>,
bpf@vger.kernel.org, Daniel Borkmann <daniel@iogearbox.net>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Jesper Dangaard Brouer <hawk@kernel.org>,
John Fastabend <john.fastabend@gmail.com>,
Jose Abreu <joabreu@synopsys.com>,
linux-arm-kernel@lists.infradead.org,
linux-arm-msm@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Vinod Koul <vkoul@kernel.org>
Subject: Re: [PATCH net-next 14/14] net: stmmac: Activate Inband/PCS flag based on the selected iface
Date: Fri, 2 Aug 2024 20:31:14 +0100 [thread overview]
Message-ID: <Zq00Ai0HFqP4yPRD@shell.armlinux.org.uk> (raw)
In-Reply-To: <yma4bknen5jc6om56eorr44uuoqtziqvk4phds6cpkrubrs5dy@esxfxtz22egh>
On Fri, Aug 02, 2024 at 02:12:08PM -0500, Andrew Halaney wrote:
> On Fri, Aug 02, 2024 at 11:47:37AM GMT, Russell King wrote:
> > From: Serge Semin <fancer.lancer@gmail.com>
> >
> > The HWFEATURE.PCSSEL flag is set if the PCS block has been synthesized
> > into the DW GMAC controller. It's always done if the controller supports
> > at least one of the SGMII, TBI, RTBI PHY interfaces. If none of these
> > interfaces support was activated during the IP-core synthesize the PCS
> > block won't be activated either and the HWFEATURE.PCSSEL flag won't be
> > set. Based on that the RGMII in-band status detection procedure
> > implemented in the driver hasn't been working for the devices with the
> > RGMII interface support and with none of the SGMII, TBI, RTBI PHY
> > interfaces available in the device.
> >
> > Fix that just by dropping the dma_cap.pcs flag check from the conditional
> > statement responsible for the In-band/PCS functionality activation. If the
> > RGMII interface is supported by the device then the in-band link status
> > detection will be also supported automatically (it's always embedded into
> > the RGMII RTL code). If the SGMII interface is supported by the device
> > then the PCS block will be supported too (it's unconditionally synthesized
> > into the controller). The later is also correct for the TBI/RTBI PHY
> > interfaces.
> >
> > Note while at it drop the netdev_dbg() calls since at the moment of the
> > stmmac_check_pcs_mode() invocation the network device isn't registered. So
> > the debug prints will be for the unknown/NULL device.
> >
> > Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
> > [rmk: fix build errors, only use PCS for SGMII if priv->dma_cap.pcs is set]
> > Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
>
> Russell, did you add in the priv->dma_cap.pcs check with SGMII just
> because it *is* expected to be set unconditionally when SGMII support is
> there?
>
> Always fan of less conditionals, so just curious as to your motivation
> since Serge's message makes it seem like SGMII && dma_cap.pcs is a
> redundant check.
I don't think that is correct. As I understand it from several
exchanges with Serge, priv->dma_cap.pcs indicates whether or not the
PCS hardware is present in the instantiated hardware. The PCS hardware
is specific to SGMII, TBI, RTBI but *not* RGMII, so testing
priv->dma_cap.pcs in conjunction with RGMII has been wrong for quite
some time.
We have dropped TBI and RTBI support, so those aren't relevant anymore.
For SGMII, however, stmmac also supports XPCS, and XPCS supports SGMII.
So, one can have the situation where XPCS support is present, the
stmmac PCS is not present, and SGMII mode has been set.
In that case, we must not set priv->hw->pcs to STMMAC_PCS_SGMII even
if we are in SGMII mode, but priv->dma_cap.pcs indicates that the PCS
hardware is not present.
--
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-08-02 19:32 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-02 10:45 [PATCH RFC v3 0/14] net: stmmac: convert stmmac "pcs" to phylink Russell King (Oracle)
2024-08-02 10:46 ` [PATCH net-next 01/14] net: stmmac: qcom-ethqos: add ethqos_pcs_set_inband() Russell King (Oracle)
2024-08-02 17:55 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 02/14] net: stmmac: replace ioaddr with stmmac_priv for pcs_set_ane() method Russell King (Oracle)
2024-08-02 18:01 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 03/14] net: stmmac: remove pcs_get_adv_lp() support Russell King (Oracle)
2024-08-02 18:08 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 04/14] net: stmmac: add infrastructure for hwifs to provide PCS Russell King (Oracle)
2024-08-02 18:27 ` Andrew Halaney
2024-08-02 10:46 ` [PATCH net-next 05/14] net: stmmac: provide core phylink PCS infrastructure Russell King (Oracle)
2024-08-02 10:46 ` [PATCH net-next 06/14] net: stmmac: dwmac1000: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 07/14] net: stmmac: dwmac1000: move PCS interrupt control Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 08/14] net: stmmac: dwmac4: convert sgmii/rgmii "pcs" to phylink Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 09/14] net: stmmac: dwmac4: move PCS interrupt control Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 10/14] net: stmmac: move dwmac_ctrl_ane() into stmmac_pcs.c Russell King (Oracle)
2024-08-02 18:45 ` Andrew Halaney
2024-08-02 10:47 ` [PATCH net-next 11/14] net: stmmac: pass stmmac_pcs into dwmac_pcs_isr() Russell King (Oracle)
2024-08-02 18:52 ` Andrew Halaney
2024-08-02 10:47 ` [PATCH net-next 12/14] net: stmmac: rename PCS registers Russell King (Oracle)
2024-08-02 10:47 ` [PATCH net-next 13/14] net: stmmac: remove obsolete pcs methods and associated code Russell King (Oracle)
2024-08-02 19:02 ` Andrew Halaney
2024-08-02 19:22 ` Russell King (Oracle)
2024-08-05 15:07 ` Andrew Halaney
2024-08-02 10:47 ` [PATCH net-next 14/14] net: stmmac: Activate Inband/PCS flag based on the selected iface Russell King
2024-08-02 19:12 ` Andrew Halaney
2024-08-02 19:31 ` Russell King (Oracle) [this message]
2024-08-02 19:52 ` [PATCH RFC v3 0/14] net: stmmac: convert stmmac "pcs" to phylink Andrew Halaney
2024-08-02 22:48 ` Jakub Kicinski
2024-08-05 10:11 ` Bartosz Golaszewski
2024-08-05 10:14 ` Bartosz Golaszewski
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=Zq00Ai0HFqP4yPRD@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=ahalaney@redhat.com \
--cc=alexandre.torgue@foss.st.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fancer.lancer@gmail.com \
--cc=hawk@kernel.org \
--cc=joabreu@synopsys.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=vkoul@kernel.org \
/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).