mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Alvin Šipraga" <alvin.sipraga@analog.com>
To: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Cc: 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
Subject: Re: [PATCH net-next v7 08/10] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes
Date: Fri, 6 Nov 2026 15:28:30 +0100	[thread overview]
Message-ID: <au3hdMxLSilNxhnK@analog.com> (raw)
In-Reply-To: <3ecac0ea-830b-47a0-931a-67fea637f0c3@yahoo.com>

On Mon, Nov 02, 2026 at 03:43:45PM +0100, Mieczyslaw Nalewaj wrote:
> The family D receiver latches on the DISABLE -> HSGMII edge in SDS_MISC
> rather than on the value, and it will not latch until the MAC at the

I don't understand this at all, should it be obvious what you mean by
"edge" and "latch" here? I would assume you are talking about interrupts
but it's not clear.

> other end of the trunk has brought its own half of the link up. If it
> does not latch, the trunk reports 2.5Gbps/Full on both sides but moves
> no frames: the CPU MAC transmits, the switch CPU port counts no octets,
> and there are no CRC, alignment or FIFO errors.
> 
> The two ends can be seconds apart, e.g. on an IPQ5018 board:
> 
>   5.27  rtl8365mb: configuring for fixed/2500base-x   <- pcs_config()
>   7.72  ipq5018-gmac-dwmac eth0: configuring for fixed/2500base-x
>   8.02  ipq5018-gmac-dwmac eth0: Link is Up - 2.5Gbps/Full
>   8.56  SerDes latches
> 
> pcs_config() runs seconds before the far-end MAC even starts
> configuring, so a single edge driven from there is not enough: the
> receiver has nothing to latch onto yet. Neither is pcs_link_up(),
> which is seconds early for the same reason. phylink does not help
> either - it never calls rtl8365mb_pcs_get_state() for this port in
> the first place, since mb->pcs.poll only arms phylink's own poll for
> in-band links, and this CPU port is a fixed link.

OK, I'm out of the loop regarding the SerDes stuff. But I find this
patch quite baroque and the reasoning hard to follow, with a lot of
strange terminology (episode, latch, "value"?). Maybe it's just me.

Is the shortcoming/issue you are addressing one of DSA when a SerDes is
used in the CPU link? Or is it rather some hardware oddity?

Can we use interrupts instead of polling?

The notifier block, extra locking, etc. gives me the creeps and seems
like a lot of infrastructure to solve something I don't
understand. Sorry if my questions are dumb, but I need a better
explanation of the whole problem to review this properly.

> 
> There is no local signal that predicts when the far-end MAC will
> bring up its half of the link (bit 8 of the SDS link-status word
> does not change ahead of it), so the work cannot wait for it; it can
> only tell afterwards, from the link-status bit, whether an edge took.

You talk about "it" and "work" but it is unclear what you mean. You've
added some scheduled work in this patch but you do not make that
apparent in the commit message here.

> 
> The far-end MAC starts when its conduit is brought up, which DSA
> reports through ->conduit_state_change(), so an episode of re-latch
> attempts starts there. Only the conduit of the CPU port that carries
> the SerDes (port 6) is considered: the chip can have a second CPU
> port on RGMII, and its conduit says nothing about the SerDes link.
> pcs_config() only arms the work, and starts an episode itself if that
> conduit is already up. The work re-arms itself after each edge; the
> next run checks whether the edge took, rather than waiting on a poll
> that will not come. When the conduit goes down the work is stopped, so
> a link without a far end is not reported as lost and not parked every
> 10 s.

I'm basically wondering here if this is not something that DSA or
phylink could help with?

[...]

Cutting the rest for now!

Kind regards,
Alvin

  parent reply	other threads:[~2026-11-06 14:28 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3bf4dd70-9771-497b-8c27-e925e0ef81eb.ref@yahoo.com>
2026-11-02 14:34 ` [PATCH net-next v7 0/10] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-02 14:36   ` [PATCH net-next v7 01/10] dt-bindings: net: dsa: realtek: add RTL8367S-VB Mieczyslaw Nalewaj
2026-11-02 14:37   ` [PATCH net-next v7 02/10] net: dsa: realtek: rtl8365mb: add chip family infrastructure Mieczyslaw Nalewaj
2026-11-02 14:38   ` [PATCH net-next v7 03/10] net: dsa: realtek: rtl8365mb: set speed for family D Mieczyslaw Nalewaj
2026-11-04 12:20     ` Alvin Šipraga
2026-11-02 14:39   ` [PATCH net-next v7 04/10] net: dsa: realtek: rtl8365mb: set RGMII mode " Mieczyslaw Nalewaj
2026-11-04 12:39     ` Alvin Šipraga
2026-11-05  7:56       ` Mieczyslaw Nalewaj
2026-11-05 12:39         ` Alvin Šipraga
2026-11-05 15:27           ` Mieczyslaw Nalewaj
2026-11-06 13:50             ` Alvin Šipraga
2026-11-06 14:56               ` Mieczyslaw Nalewaj
2026-11-06 15:15                 ` Alvin Šipraga
2026-11-06 16:43                   ` Mieczyslaw Nalewaj
2026-11-06 15:11               ` Mieczyslaw Nalewaj
2026-11-02 14:40   ` [PATCH net-next v7 05/10] net: dsa: realtek: rtl8365mb: set and get vlan 4k " Mieczyslaw Nalewaj
2026-11-04 12:45     ` Alvin Šipraga
2026-11-02 14:41   ` [PATCH net-next v7 06/10] net: dsa: realtek: rtl8365mb: use raw VID for PVID on " Mieczyslaw Nalewaj
2026-11-02 14:42   ` [PATCH net-next v7 07/10] net: dsa: realtek: rtl8365mb: add family D SDS13 PCS support Mieczyslaw Nalewaj
2026-11-02 14:43   ` [PATCH net-next v7 08/10] net: dsa: realtek: rtl8365mb: re-latch the family D SerDes Mieczyslaw Nalewaj
2026-11-04 12:57     ` Alvin Šipraga
2026-11-05  7:18       ` Mieczyslaw Nalewaj
2026-11-05  8:52         ` Alvin Šipraga
2026-11-05 10:24           ` Mieczyslaw Nalewaj
2026-11-05 12:09             ` Alvin Šipraga
2026-11-06 14:28     ` Alvin Šipraga [this message]
2026-11-06 14:56       ` Mieczyslaw Nalewaj
2026-11-06 15:46         ` Alvin Šipraga
2026-11-06 15:49       ` Andrew Lunn
2026-11-02 14:44   ` [PATCH net-next v7 09/10] net: dsa: realtek: rtl8365mb: make L2/LUT access work on family D Mieczyslaw Nalewaj
2026-11-03 15:36     ` Alvin Šipraga
2026-11-03 16:44       ` Mieczyslaw Nalewaj
2026-11-02 14:45   ` [PATCH net-next v7 10/10] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB Mieczyslaw Nalewaj
2026-11-03 22:52     ` Alvin Šipraga
2026-11-03 23:41       ` Mieczyslaw Nalewaj
2026-11-04  9:40         ` Mieczyslaw Nalewaj
2026-11-04 13:14           ` Alvin Šipraga
2026-11-04 16:37             ` Mieczyslaw Nalewaj

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=au3hdMxLSilNxhnK@analog.com \
    --to=alvin.sipraga@analog.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --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®