2022-02-06 13:58:23

by Andrew Lunn

[permalink] [raw]
Subject: Re: [PATCH] net: phy: mscc: enable MAC SerDes autonegotiation

On Sat, Feb 05, 2022 at 12:14:52PM +0530, Raag Jadav wrote:
> Enable MAC SerDes autonegotiation to distinguish between
> 1000BASE-X, SGMII and QSGMII MAC.

How does autoneg help you here? It just tells you about duplex, pause
etc. It does not indicate 1000BaseX, SGMII etc. The PHY should be
using whatever mode it was passed in phydev->interface, which the MAC
sets when it calls the connection function. If the PHY dynamically
changes its host side mode as a result of what that line side is
doing, it should also change phydev->interface. However, as far as i
can see, the mscc does not do this.

So i don't understand this commit message.

Andrew


2022-02-07 16:17:34

by Raag Jadav

[permalink] [raw]
Subject: Re: [PATCH] net: phy: mscc: enable MAC SerDes autonegotiation

On Sat, Feb 05, 2022 at 03:57:49PM +0100, Andrew Lunn wrote:
> On Sat, Feb 05, 2022 at 12:14:52PM +0530, Raag Jadav wrote:
> > Enable MAC SerDes autonegotiation to distinguish between
> > 1000BASE-X, SGMII and QSGMII MAC.
>
> How does autoneg help you here? It just tells you about duplex, pause
> etc. It does not indicate 1000BaseX, SGMII etc. The PHY should be
> using whatever mode it was passed in phydev->interface, which the MAC
> sets when it calls the connection function. If the PHY dynamically
> changes its host side mode as a result of what that line side is
> doing, it should also change phydev->interface. However, as far as i
> can see, the mscc does not do this.
>

Once the PHY auto-negotiates parameters such as speed and duplex mode
with its link partner over the copper link as per IEEE 802.3 Clause 27,
the link partner’s capabilities are then transferred by PHY to MAC
over 1000BASE-X or SGMII link using the auto-negotiation functionality
defined in IEEE 802.3z Clause 37.

So any dynamic change in link partner’s capabilities over the copper link
can break MAC to PHY communication if MAC SerDes autonegotiation is disabled
even on active MAC interface link.

Is this understanding correct?

> So i don't understand this commit message.
>

Will send out a v2 with updated commit message on confirmation.

Cheers,
Raag

> Andrew

2022-02-07 17:37:11

by Russell King (Oracle)

[permalink] [raw]
Subject: Re: [PATCH] net: phy: mscc: enable MAC SerDes autonegotiation

On Sun, Feb 06, 2022 at 10:42:34PM +0530, Raag Jadav wrote:
> Once the PHY auto-negotiates parameters such as speed and duplex mode
> with its link partner over the copper link as per IEEE 802.3 Clause 27,
> the link partner’s capabilities are then transferred by PHY to MAC
> over 1000BASE-X or SGMII link using the auto-negotiation functionality
> defined in IEEE 802.3z Clause 37.

This is slightly incorrect. 1000BASE-X is only capable of operating at
gigabit speed, not at 100M or 10M.

The PHY _might_ signal the copper side pause resolution via the
1000BASE-X negotiation word, and even rarer would be whether operating
at 1G FD or 1G HD.

Out of the two, only SGMII is capable of operating at 1G, 100M and 10M,
FD or HD. No pause resolution is passed. SGMII is not an 802.3 defined
protocol, it's an adaption of 1000BASE-X by Cisco.

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