net: phy: marvell: Avoid unnecessary soft reset
authorFlorian Fainelli <f.fainelli@gmail.com>
Tue, 25 Sep 2018 18:28:46 +0000 (11:28 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Sep 2018 03:26:45 +0000 (20:26 -0700)
commitd6ab93364734bd88a1011432faa9253680f7e9da
treed4212b6bc158f001a595aecc3f3018ccb62829cb
parent6e2d85ec05591b739059f65fe8438c9c5999f7d8
net: phy: marvell: Avoid unnecessary soft reset

The BMCR.RESET bit on the Marvell PHYs has a special meaning in that
it commits the register writes into the HW for it to latch and be
configured appropriately. Doing software resets causes link drops, and
this is unnecessary disruption if nothing changed.

Determine from marvell_set_polarity()'s return code whether the register value
was changed and if it was, propagate that to the logic that hits the software
reset bit.

This avoids doing unnecessary soft reset if the PHY is configured in
the same state it was previously, this also eliminates the need for a
m88e1111_config_aneg() function since it now is the same as
marvell_config_aneg().

Tested-by: Wang, Dongsheng <dongsheng.wang@hxt-semitech.com>
Tested-by: Chris Healy <cphealy@gmail.com>
Tested-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Clemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/marvell.c