Subject: Re: [PATCH v4 net-next 0/8] Let phylink manage in-band AN for the PHY

From: "Russell King (Oracle)" <[email-masked]>
Date: Tue, 22 Nov 2022 09:16:52 +0000

On Mon, Nov 21, 2022 at 01:38:31PM -0500, Sean Anderson wrote:
> # dmesg | grep net6
> [    3.826156] fsl_dpaa_mac 1aea000.ethernet net6: renamed from eth3
> [    5.062654] fsl_dpaa_mac 1aea000.ethernet net6: PHY driver does not report in-band autoneg capability, assuming true
> [    5.089724] fsl_dpaa_mac 1aea000.ethernet net6: PHY [0x0000000001afc000:04] driver [RTL8211F Gigabit Ethernet] (irq=POLL)
> [    5.089734] fsl_dpaa_mac 1aea000.ethernet net6: phy: sgmii setting supported 0,00000000,00000000,000062ea advertising 0,00000000,00000000,000062ea
> [    5.089782] fsl_dpaa_mac 1aea000.ethernet net6: configuring for inband/sgmii link mode
> [    5.089786] fsl_dpaa_mac 1aea000.ethernet net6: major config sgmii
> [    5.090951] fsl_dpaa_mac 1aea000.ethernet net6: phylink_mac_config: mode=inband/sgmii/Unknown/Unknown/none adv=0,00000000,00000000,000062ea pause=00 link=0 an=1
> [    5.118325] fsl_dpaa_mac 1aea000.ethernet net6: phy link down sgmii/Unknown/Unknown/none/off
> [    9.214204] fsl_dpaa_mac 1aea000.ethernet net6: phy link up sgmii/1Gbps/Full/none/rx/tx
> [    9.214247] fsl_dpaa_mac 1aea000.ethernet net6: Link is Up - 1Gbps/Full - flow control rx/tx
> 
> I believe this is the same issue I ran into before. This is why I
> defaulted to in-band.

Yes, when operating in SGMII mode, some PHYs:
1) require SGMII in-band to be acknowledged by the MAC
2) provide SGMII in-band but will time out
3) don't provide any SGMII in-band

It sounds like you have case (1), and the options currently are (as
you've identified) to either state in DT that in-band is being used,
or use ovr_an_inband in the driver (if it's a recent conversion that
used in-band mode without needing extra properties.)

Vladimir's patches provide us another way to solve this problem - but
relies upon the PHY drivers being updated to correctly report whether
the hardware will be using in-band. If they don't, then we're lost at
sea and have no idea whether (1) or (3) applies, and in that case we
have to fall back to today's behaviour, which is dependent on
describing it in DT or using ovr_an_inband.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!