net: phylink: explicitly configure in-band autoneg for PHYs that support it
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 12 Feb 2021 17:01:52 +0000 (19:01 +0200)
committerVladimir Oltean <olteanv@gmail.com>
Tue, 8 Jun 2021 10:23:58 +0000 (13:23 +0300)
commitffb89801a541ac368d87b144a4f264cbcd8642ea
tree47c48e75b0219d61f366a003925c1748e19fecbb
parentac3c3de2ff287a31ea32e135ca889af339d3926d
net: phylink: explicitly configure in-band autoneg for PHYs that support it

Currently Linux has no control over whether a MAC-to-PHY interface uses
in-band signaling or not, even though phylink has the
managed = "in-band-status";
property which denotes that the MAC expects in-band signaling to be used.

The problem is really that if the in-band signaling is configurable in
both the PHY and the MAC, there is a risk that they are out of sync
unless phylink manages them both. Most if not all in-band autoneg state
machines follow IEEE 802.3 clause 37, which means that they will not
change the operating mode of the SERDES lane from control to data mode
unless in-band AN completed successfully. Therefore traffic will not
work.

It is particularly unpleasant that currently, we assume that PHYs which
have configurable in-band AN come pre-configured from a prior boot stage
such as U-Boot, because once the bootloader changes, all bets are off.

Let's introduce a new PHY driver method for configuring in-band autoneg,
and make phylink be its first user. The main PHY library does not call
phy_config_inband_autoneg, because it does not know what to configure it
to. Presumably, non-phylink drivers can also call phy_config_inband_autoneg
individually.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
drivers/net/phy/phy.c
drivers/net/phy/phylink.c
include/linux/phy.h