From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Zxyan Zhu <zxyan0222@gmail.com>,
andrew+netdev@lunn.ch, rmk+kernel@armlinux.org.uk,
alexandre.torgue@foss.st.com
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, hkallweit1@gmail.com,
mcoquelin.stm32@gmail.com, netdev@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Oleksij Rempel <o.rempel@pengutronix.de>
Subject: Re: [PATCH net-next v2] net: phylink: add phylink_pcs_loopback() method for PCS loopback support
Date: Tue, 28 Jul 2026 10:41:12 +0200 [thread overview]
Message-ID: <2c0c6864-99ea-48d6-a889-c886bb91c351@bootlin.com> (raw)
In-Reply-To: <20260727120704.2319467-1-zxyan0222@gmail.com>
Hi,
On 7/27/26 14:07, Zxyan Zhu wrote:
> Some Ethernet MAC drivers (such as stmmac) need to perform PCS-level
> loopback for selftest purposes when no external PHY is present. Add a
> new phylink_pcs_loopback() method that allows MAC drivers to request
> PCS loopback mode through the phylink framework.
>
> Implement the pcs_loopback callback in the stmmac integrated PCS
> using the GMAC_AN_CTRL_ELE register bit. Add a helper function
> stmmac_selftest_get_pcs() in stmmac selftests to unify PCS lookup
> across glue driver PCS and integrated PCS. Update the selftest
> enable/disable paths to use the new helper.
>
> Signed-off-by: Zxyan Zhu <zxyan0222@gmail.com>
I'm actually seriously wondering if we shouldn't just stick to MAC loopback only
for stmmac selftests. I even have a patch ready to send for that, as I've
been struggling with selftests in the past days because some PHYs will
either stop their RXC while in loopback, or bring the carrier down which
makes the dev_xmit drop the packets we're sending to ourselves.
Using an external loopnback (in PCS, in PHY, somewhere else...) doesn't
bring anything to the table given what we are testing today, which is
internal stmmac behaviour. The MAC loopback (on dwmac1000 and dwmac4 at
least) happends at the GMII level, so everything we are currently testing
happens before that.
If the goal is to validate what comes after (RGMII, PCS behaviour and so on),
I think we should instead add some other, more generic selftests that aren't
stmmac specific, that we could run on any netdev, such as the ones Oleksij
has added in:
3e1e58d64c3d net: add generic selftest support
Maxime
next prev parent reply other threads:[~2026-07-28 8:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 12:07 [PATCH net-next v2] net: phylink: add phylink_pcs_loopback() method for PCS loopback support Zxyan Zhu
2026-07-28 8:41 ` Maxime Chevallier [this message]
2026-07-28 13:02 ` Oleksij Rempel
2026-07-28 13:22 ` Zxyan Zhu
-- strict thread matches above, loose matches on Subject: below --
2026-07-24 8:52 [PATCH net-next] " Zxyan Zhu
2026-07-27 9:38 ` [PATCH net-next v2] " Zxyan Zhu
2026-07-27 19:46 ` Andrew Lunn
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=2c0c6864-99ea-48d6-a889-c886bb91c351@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.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=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=zxyan0222@gmail.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.