[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210213201255.ygjn7rexook2ngqe@skbuf>
Date: Sat, 13 Feb 2021 22:12:55 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Michael Walle <michael@...le.cc>
Cc: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Antoine Tenart <atenart@...nel.org>,
Quentin Schulz <quentin.schulz@...tlin.com>,
netdev@...r.kernel.org, Heiner Kallweit <hkallweit1@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Russell King - ARM Linux admin <linux@...linux.org.uk>,
Ioana Ciornei <ioana.ciornei@....com>,
Maxim Kochetkov <fido_max@...ox.ru>,
Bjarni Jonasson <bjarni.jonasson@...rochip.com>,
Steen Hegelund <steen.hegelund@...rochip.com>,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH net-next 1/2] net: phylink: explicitly configure in-band
autoneg for PHYs that support it
On Sat, Feb 13, 2021 at 08:57:46PM +0100, Michael Walle wrote:
> > On the other hand, I never meant for the inband autoneg setting to only
> > be configurable both ways.
>
> Then why is there a "bool enabled"?
Let me stress the word _only_ both ways. The whole point of the "bool
enabled" is to attempt coordination with the 'managed = "in-band-status"'
property device tree property of the MAC, or to error out if it is not
possible.
> > I expect some PHYs are not able to operate
> > using noinband mode, and for those I guess you should simply return
> > -EINVAL, allowing the system designer to know that the configuration
> > will not work and why.
>
> You mean like this:
>
> static int at803x_config_inband_aneg(struct phy_device *phydev, bool
> enabled)
> {
> if (!enabled)
> return -EINVAL;
> /* enable SGMII autoneg */
> return phy_write_paged(...);
> }
>
> But then why bother with config_inband_aneg() at all and just enable
> it unconditionally in config_init(). [and maybe keep the return -EINVAL].
Because .config_init() is generic code, while .config_inband_autoneg()
is phylink-specific. Generally I don't want to make any assumption about
the state in which a PHY driver used to operate prior to this series.
If you are sure that at803x.c user relies on a prior bootloader stage
having disabled in-band AN, then sure, I suppose you can enable it
unconditionally in .config_init().
For VSC8514 I put the configuration deliberately in a phylink-specific
callback since I trust that at least the MAC-side drivers were reviewed
for proper use of MLO_AN_PHY vs MLO_AN_INBAND.
> Which then begs the question, does it makes sense on (Q)SGMII links at
> all?
See above. In the general case we need to assume a wild world where the
same PHY driver operates as inband on some platforms and noinband on
others (and most importantly, it works on both, which we'd like to
preserve at least). I would be glad if we didn't need to make that
assumption though.
Powered by blists - more mailing lists