Re: [PATCH RFC net-next] net: pcs: pcs-mtk-lynxi fix mtk_pcs_lynxi_get_state() for 2500base-x

Eric Woudstra
2024-01-02T12:55:35Z

>Please describe your setup more fully. What is the link partner on this
>2500base-X link?

I use a BananaPi R3, with the oem-sfp2.5g-t module. It has the SFP quirk that disables autoneg. I was trying Marek's rtl8221b patchset, but found that even with unmodified code, original net-next unmodified, I could get link up, but no traffic is going through.

On the other side is a.rock5b with rtl8125b.

Only after applying this patch, it works and eth1 reports link up with 2.5Gbps instead of unknown speed.

If you need more debugging info, I can supply it at a later time.

On January 2, 2024 1:10:01 PM GMT+01:00, "Russell King (Oracle)" <linux@armlinux.org.uk> wrote:
>On Tue, Jan 02, 2024 at 08:44:08AM +0100, Eric Woudstra wrote:
>> From: Daniel Golle <daniel@makrotopia.org>
>>
>> Need to fix mtk_pcs_lynxi_get_state() in order for the pcs to function
>> correctly when the interface is set to 2500base-x, even when
>> PHYLINK_PCS_NEG_INBAND_DISABLED is set.
>
>Please describe your setup more fully. What is the link partner on this
>2500base-X link?
>
>In PHYLINK_PCS_NEG_INBAND_DISABLED mode, this means that phylink is
>operating in inband mode, but Autoneg is clear in the advertisement
>mask, meaning Autoneg is disabled and we are using a "fixed" setting.
>state->speed and state->duplex should already be initialised.
>
>> When the pcs is set to 2500base-x, the register values are not compatible
>> with phylink_mii_c22_pcs_decode_state(). It results in parameters such as
>> speed unknown and such. Then the mac/pcs are setup incorrectly and do not
>> function.
>
>Since Autoneg is clear, phylink_mii_c22_pcs_decode_state() won't
>change state->speed and state->duplex, which should already be
>correctly set.
>