]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: phy: meson-gxl: detect LPA corruption
authorJerome Brunet <jbrunet@baylibre.com>
Fri, 8 Dec 2017 11:08:11 +0000 (12:08 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 16:18:33 +0000 (11:18 -0500)
commitf1e2400a80ff55eb7c5f4fd9d7eb163fd0de9a2c
treecc19ef9d60473bf211269d9baac580bfadff5a1b
parenta8ceb5dbfde1092b466936bca0ff3be127ecf38e
net: phy: meson-gxl: detect LPA corruption

The purpose of this change is to fix the incorrect detection of the link
partner (LP) advertised capabilities which sometimes happens with this PHY
(roughly 1 time in a dozen)

This issue may cause the link to be negotiated at 10Mbps/Full or
10Mbps/Half when 100MBps/Full is actually possible. In some case, the link
is even completely broken and no communication is possible.

To detect the corruption, we must look for a magic undocumented bit in the
WOL bank (hint given by the SoC vendor kernel) but this is not enough to
cover all cases. We also have to look at the LPA ack. If the LP supports
Aneg but did not ack our base code when aneg is completed, we assume
something went wrong.

The detection of a corrupted LPA triggers a restart of the aneg process.
This solves the problem but may take up to 6 retries to complete.

Fixes: 7334b3e47aee ("net: phy: Add Meson GXL Internal PHY driver")
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/meson-gxl.c