]> www.infradead.org Git - users/hch/misc.git/commit
net: phylib: do not disable autoneg for fixed speeds >= 1G
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 8 Aug 2024 11:41:22 +0000 (12:41 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Aug 2024 16:04:29 +0000 (17:04 +0100)
commit6ff3cddc365beae1fbe185fd470cc0b86e895574
treec31b87ae62e7e357d610cad73b0862b481fe7dcd
parentaa9fbc5dd9da9e095a8b1a58540cf20cb06f595f
net: phylib: do not disable autoneg for fixed speeds >= 1G

We have an increasing number of drivers that are forcing
auto-negotiation to be enabled for speeds of 1G or faster.

It would appear that auto-negotiation is mandatory for speeds above
100M. In 802.3, Annex 40C's state diagrams seems to imply that
mr_autoneg_enable (BMCR AN ENABLE) doesn't affect whether or not the
AN state machines work for 1000base-T, and some PHY datasheets (e.g.
Marvell Alaska) state that disabling mr_autoneg_enable leaves AN
enabled but forced to 1G full duplex.

Other PHY datasheets imply that BMCR AN ENABLE should not be cleared
for >= 1G.

Thus, this should be handled in phylib rather than in each driver.

Rather than erroring out, arrange to implement the Marvell Alaska
solution but in software for all PHYs: generate an appropriate
single-speed advertisement for the requested speed, and keep AN
enabled to the PHY driver. However, to avoid userspace API breakage,
continue to report to userspace that we have AN disabled.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/phy_device.c