Thread (18 messages) flat view 18 messages, 4 authors, 2021-02-14

Re: [PATCH net-next 1/2] net: phylink: explicitly configure in-band autoneg for PHYs that support it

From: Vladimir Oltean <olteanv@gmail.com>
Date: 2021-02-13 20:13:48

On Sat, Feb 13, 2021 at 08:57:46PM +0100, Michael Walle wrote:
quoted
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.
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help