mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alvin Šipraga" <alvin.sipraga@analog.com>
To: Johan Alvarado <contact@c127.dev>
Cc: Mieczyslaw Nalewaj <namiltd@yahoo.com>,
	gabonpivovich@gmail.com, linusw@kernel.org, andrew@lunn.ch,
	olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk,
	luizluca@gmail.com, maxime.chevallier@bootlin.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com
Subject: Re: [PATCH net-next v9 08/11] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes
Date: Tue, 10 Nov 2026 10:33:30 +0100	[thread overview]
Message-ID: <avLkYrPN97sU7HKH@analog.com> (raw)
In-Reply-To: <b68807e4-1470-4f4b-8975-e8a70dffd011@c127.dev>

On Tue, Nov 10, 2026 at 12:49:04AM -0500, Johan Alvarado wrote:
> Hi Mieczyslaw, Alvin, Oleg,
> 
> Thanks for holding off. I could reproduce the symptom here and I'm now
> fairly sure the cause is on the SoC side, not in rtl8365mb.
> 
> Setup: Mercusys MR80X v2 (IPQ5018 + RTL8367S, family C), CPU port 6 at
> 2500base-x, booting from NAND with a real config in a reboot loop. A
> boot counts as broken when CPU port receives nothing, or frames with FCS
> errors, while both ends report 2.5Gbps/Full. Both flavours happen.
> 
> Results, same rtl8365mb code in all of them:
> - OpenWrt 6.18 stack (stmmac dwmac-ipq5018 + the qca-uniphy PCS):
>   18 of 51 boots broken.
> - Older stack (qca-nss-dp + qca-ssdk, 6.12): 0 of 16.
> - 6.18 stack, switch SerDes brought up only once the conduit is up
>   (the OpenWrt ordering patch): 0 of 16.
> - 6.18 stack, UNIPHY mode sequence moved to the GMAC probe, nothing
>   changed in the switch driver: 0 of 32.
> 
> The bootloader hands the UNIPHY over in SGMII (1.25G line rate), and the
> qca-uniphy PCS only programs it from pcs_config(), which on this board
> runs at the first ndo_open of the conduit. The switch
> brings its SerDes up in HSGMII at DSA setup, about two seconds earlier,
> so its receiver trains against a transmitter at the wrong line rate.
> I read the UNIPHY mode registers at probe and at each pcs_config() on
> every boot: SGMII until the first open, SGMII+ after it, identical on
> good and broken boots. About a third of the boots end up with a
> receiver that does not recover when the far end later switches to
> SGMII+.
> 
> Some checks that point at the switch receiver, not at the MAC/PCS:
> - Broken boot: A full UNIPHY re-sequence on the SoC side does not cure
>   it. Unbinding and binding the switch driver cures it every time.
> - Switch SerDes brought up against an already programmed UNIPHY: 21 of
>   21 good, even with a UNIPHY PLL reset one second later. The PLL
>   reset on a settled link is harmless (12 of 12), so I don't think the
>   10 s health check in patch 8 covers a real case.
> 
> So the "far end not up yet" in the commit message is, at least on this
> SoC, "far end up at the wrong line rate". Once the far end is in the
> right mode before the switch comes up, the receiver latches on the first
> try and nothing needs to be re-latched. The two second gap in the
> reported timeline (5.27 switch pcs_config, 7.72 eth0 configuring) is the
> same window I see.
> 
> This is a family C board and I can't say whether the family D receiver
> behaves the same. But the reported log is the same SoC with the same
> OpenWrt stack, so the wrong-mode far end is present in that setup too.
> Oleg, could you check this on the AX55 before the first ifup of the
> conduit? A single register read tells:
> 
>   devmem 0x98218    # UNIPHY MISC2: 0x70 = SGMII, 0x50 = SGMII+
> 
> If it reads 0x70 there, patch 8 is working around the same thing.
> 
> The fix on the SoC side is one commit in the OpenWrt PCS driver, about
> 50 lines: run the mode sequence at GMAC probe, before the switch
> probes. Rebased on current OpenWrt main, so it should apply to the
> AX55 tree as is:
> 
>   https://github.com/c127dev/openwrt/commit/50e49862d2ba1abd0c93b64403c776af200323fb
> 
> Oleg, if the AX55 can take it, a reboot loop with that commit and
> without patch 8 would settle this. I'll open the OpenWrt PR once that
> is confirmed.
> 
> Neither dwmac-ipq5018 nor pcs-qca-uniphy is in mainline, so none of
> this can be reproduced on a mainline kernel. That's why I'd rather not
> have the workqueue, the extra locks and the reboot notifier in
> rtl8365mb for it.

Thanks for looking into this Johan.

I guess if this can be fixed on the SoC side (which Oleg can hopefully
check on family D), then we can drop this patch from the series
altogether. Correct?

Kind regards,
Alvin

  reply	other threads:[~2026-11-10  9:34 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <9b73858d-fc09-4988-8bab-fd7b88db9412.ref@yahoo.com>
2026-11-08  8:04 ` [PATCH net-next v9 00/11] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08  8:05   ` [PATCH net-next v9 01/11] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08  8:06   ` [PATCH net-next v9 02/11] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-08 14:20     ` Linus Walleij
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:07   ` [PATCH net-next v9 03/11] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-08  8:08   ` [PATCH net-next v9 04/11] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:09   ` [PATCH net-next v9 05/11] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-11-08  8:10   ` [PATCH net-next v9 06/11] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-11-08  8:11   ` [PATCH net-next v9 07/11] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:11   ` [PATCH net-next v9 08/11] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-11-08 19:13     ` Johan Alvarado
2026-11-08 20:53       ` Mieczyslaw Nalewaj
2026-11-10  5:49         ` Johan Alvarado
2026-11-10  9:33           ` Alvin Šipraga [this message]
2026-11-10 11:22             ` Mieczyslaw Nalewaj
2026-11-08  8:12   ` [PATCH net-next v9 09/11] net: dsa: realtek: rtl8365mb: refactor L2 MAC handling Mieczyslaw Nalewaj
2026-11-08  8:13   ` [PATCH net-next v9 10/11] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-09  8:52     ` netdev-bot+sashiko
2026-11-08  8:14   ` [PATCH net-next v9 11/11] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-08 14:21     ` Linus Walleij

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=avLkYrPN97sU7HKH@analog.com \
    --to=alvin.sipraga@analog.com \
    --cc=andrew@lunn.ch \
    --cc=contact@c127.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fabianotassotti@gmail.com \
    --cc=gabonpivovich@gmail.com \
    --cc=gusfmora@gmail.com \
    --cc=kuba@kernel.org \
    --cc=kuncy7@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=luizluca@gmail.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=namiltd@yahoo.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®