Subject: Re: [PATCH 2/2] at803x: double check SGMII side autoneg

From: Andrew Lunn <[email-masked]>
Date: Wed, 24 May 2017 16:09:29 +0200

On Wed, May 24, 2017 at 08:48:04AM -0500, Timur Tabi wrote:
> On 5/24/17 8:40 AM, Andrew Lunn wrote:
> 
> >You need to prove this, that the link is not up. Any by link, we mean
> >both the copper and the SGMII link.
> 
> I can post the log of my iperf run showing that the, when
> at803x_aneg_done() returns zero, no packets can go through.  And
> then after I change at803x_aneg_done() so that it returns
> BMSR_ANEGCOMPLETE, then packets do go through.  Is that the proof
> you're looking for?

No. I would like to see the status of the copper side and the status
of the SGMII side, at the point at803x_aneg_done() is called.

If the copper side is up, but the SGMII side is down, returning 0 is
correct.

> Exxactly.  That's because the link IS up, and so there is no
> opportunity to receive another interrupt.

It could be, the copper side is up, but the SGMII side is down, at the
point at803x_aneg_done() is called. So it is correctly returning
0. Sometime later the SGMII side goes up, but there is not a second
interrupt. Hence the phy core does not know that the full, 2 stage MAC
to PHY to peer PHY link is now up.

	Andrew