Re: [PATCH net-next v3 03/13] ax88179_178a: Use MMD accessor functions for AX88179A
From: Andrew Lunn
Date: Fri Jul 24 2026 - 13:29:48 EST
> > > - val = ax88179_phy_read_mmd_indirect(dev, MDIO_PCS_EEE_ABLE,
> > > - MDIO_MMD_PCS);
> > > + val = ax_read_mmd(dev, MDIO_MMD_PCS, MDIO_PCS_EEE_ABLE);
> >
> > All these look to be standard EEE registers. phylib should be handling
> > this for you. Put a printk in genphy_c45_read_eee_cap1() and make sure
> > it is being called.
> >
> > Basically, anything which is part of 802.3 clause 22 or clause 45
> > should have helpers in phylib, and in most cases, phylib itself will
> > take care of it. A MAC driver touching the PHY is generally a bad
> > design, a layer violation. So any driver using phylink or phylib, all
> > direct access to the PHY needs to be removed.
> >
> This is again the existing code targeting the AX179, I just used the
> new MMD accessor functions that target both architectures. I cannot convert
> that with any confidence that it will work without having those devices.
> One would need to write PHY drivers and use phylink to make the mess
> go away.
This is where having a clean, separate driver will help.
You cannot have the MAC driver touching the PHY when using
phylink/phylib. You need to ensure none of this code is actually
used. And if it is not used, you don't need to touch it like this.
Andrew