]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: marvell: Fix pause frame negotiation
authorClemens Gruber <clemens.gruber@pqgruber.com>
Sat, 11 Apr 2020 16:51:25 +0000 (18:51 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 11 Apr 2020 23:51:09 +0000 (16:51 -0700)
commitca556434afb3d2656cd376f7fcc324dfa5affa14
treea5fb37d5291b31d2d92d75581ec949c2e09df74a
parentd242c834167def7786d725f6b99c6f4b632c1769
net: phy: marvell: Fix pause frame negotiation

The negotiation of flow control / pause frame modes was broken since
commit 5e0d321f1c80 ("net: phy: marvell: rearrange to use
genphy_read_lpa()") moved the setting of phydev->duplex below the
phy_resolve_aneg_pause call. Due to a check of DUPLEX_FULL in that
function, phydev->pause was no longer set.

Fix it by moving the parsing of the status variable before the blocks
dealing with the pause frames.

As the Marvell 88E1510 datasheet does not specify the timing between the
link status and the "Speed and Duplex Resolved" bit, we have to force
the link down as long as the resolved bit is not set, to avoid reporting
link up before we even have valid Speed/Duplex.

Tested with a Marvell 88E1510 (RGMII to Copper/1000Base-T)

Fixes: 5e0d321f1c80 ("net: phy: marvell: rearrange to use genphy_read_lpa()")
Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/marvell.c