RE: [PATCH v2 1/1] net: phy: micrel: Add workaround for incomplete autonegotiation

From: Asmaa Mnebhi
Date: Thu Dec 28 2023 - 16:22:11 EST


> >> Is there a Micrel errata associated with this work around that could
> >> be referenced here?
> >
> > Hi Florian,
> >
> > No there isn’t. This is based on observations and comparison with the
> behavior and testing of other PHYs. For example, we don’t see this issue with
> the Vitesse PHY.
> >
> The Microchip KSZ9031 errata documentation lists few link-related errata.
> May any of these be relevant in your case? If not, please check with Microchip.
> KSZ9031 isn't new, and most likely we would have seen such reports before, if
> there's an actual issue.
> I'd like to avoid that we add code to work around an issue that is specific to
> your setup.
>
Thanks Heiner. I went over the errata and there are couple of issues which could result in the link not coming up:

1) Module 1: Device fails to link after Asymmetric Pause capability is set
The micrel.c driver already has a workaround for this and I have verified that when our issue reproduces, only symmetric pause is enabled.

2) Module 5: Auto-Negotiation link-up failure / long link-up time due to default FLP interval setting
The micrel.c driver also already has a workaround for this.

Apart from the erratas, I see that there were other KSZ9031 issues for which workarounds were needed in the kernel:
1) commit d2fd719bcb0e83cb39cfee22ee800f98a56eceb3
net/phy: micrel: Add workaround for bad autoneg

2) commit c1a8d0a3accf64a014d605e6806ce05d1c17adf1
net: phy: micrel: ksz9031: reconfigure autoneg after phy autoneg workaround

in our case, I have verified that we don’t stumble upon the above 2 bugs (idle error count is 0x0).

Our QA sees that autonegotiation fails to complete after rebooting the system > 2000 times. So it is hard to reproduce.
Our OOB MAC is connected to the Micrel KSZ9031, which is connected to a switch.
I have checked that phy_start() calls phy_start_aneg() and that the genphy_restart_aneg() sets the BMCR_ANRESTART bit. After that, it doesn’t matter how long we wait, the PHY autonegotiation doesn’t complete and the link is down. Restarting autonegotiation a second time solves the issue.

I will share this information with Microchip. I hope they can help.

Thanks.
Asmaa