Subject: Re: [RFC] net: dsa: slave: Advertise correct EEE capabilities at slave PHY setup

From: Lukasz Majewski <[email-masked]>
Date: Tue, 30 May 2023 16:57:03 +0200

Hi Russell,

> On Tue, May 30, 2023 at 04:07:43PM +0200, Lukasz Majewski wrote:
> > Hi Russell,
> >   
> > > On Tue, May 30, 2023 at 02:26:21PM +0200, Lukasz Majewski wrote:  
> > > > One can disable in device tree advertising of EEE capabilities
> > > > of PHY when 'eee-broken-100tx' property is present in DTS.
> > > > 
> > > > With DSA switch it also may happen that one would need to
> > > > disable EEE due to some network issues.
> > > > 
> > > > Corresponding switch DTS description:
> > > > 
> > > >  switch@0 {
> > > > 	 ports {
> > > > 		port@0 {
> > > > 		reg = <0>;
> > > > 		label = "lan1";
> > > > 		phy-handle = <&switchphy0>;
> > > > 		};
> > > > 	}
> > > > 	mdio {
> > > > 		switchphy0: switchphy@0 {
> > > > 		reg = <0>;
> > > > 		eee-broken-100tx;
> > > > 	};
> > > > 	};
> > > > 
> > > > This patch adjusts the content of MDIO_AN_EEE_ADV in MDIO_MMD_AN
> > > > "device" so the phydev->eee_broken_modes are taken into account
> > > > from the start of the slave PHYs.    
> > > 
> > > This should be handled by phylib today in recent kernels without
> > > the need for any patch (as I describe below, because the
> > > config_aneg PHY method should be programming it.) Are you seeing
> > > a problem with it in 6.4-rc?  
> > 
> > Unfortunately, for this project I use LTS 5.15.z kernel.
> > 
> > My impression is that the mv88e6xxx driver is not handling EEE setup
> > during initialization (even with v6.4-rc).
> > 
> > I've tried to replace genphy_config_eee_advert() with phy_init_eee,
> > but it lacks the part to program PCS advertise registers.  
> 
> Firstly, I would advise backporting the EEE changes. The older EEE
> implementation was IMHO not particularly good (I think you can find
> a record in the archives of me stating that the old interfaces were
> just too quirky.)

Ok.

> 
> Secondly, even if you program the PHY for EEE, unless you have
> something like an Atheros AR803x PHY with its SmartEEE, EEE needs
> the support of both the PHY and the MAC to which its connected to
> in order to work. It's the MAC which is the "client" which says
> to the PHY "I'm idle" and when both ends tell their PHYs that
> they're idle, the media link can then drop into the low power
> state.

For now - I just wanted to disable the advertisement of EEE (in my use
case EEE can be sacrifice for reliability)

(However, thanks for detailed insights).

> 
> The 88e6xxx internal PHYs will communicate their EEE negotiation
> state back to the MACs,

Yes, internal PHYs are used for mv88e6071.

> but for an external PHY, that won't happen,
> and there is no code in the 88e6xxx driver to configure the MAC to
> program the MAC to do EEE.

Ok. I see.

> 
> So, I'm wondering what's actually going on here... can you give
> any more details about the hardware setup?
> 

I'm using standard mv88e6071 setup (it is recognized as fixed-link PHY
from imx8 fec side).

Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: [email-masked]