Skip to content

Commit fe4f57b

Browse files
Pavel Parkhomenkokuba-moo
authored andcommitted
net: phy: marvell: Fix RGMII Tx/Rx delays setting in 88e1121-compatible PHYs
It is mandatory for a software to issue a reset upon modifying RGMII Receive Timing Control and RGMII Transmit Timing Control bit fields of MAC Specific Control register 2 (page 2, register 21) otherwise the changes won't be perceived by the PHY (the same is applicable for a lot of other registers). Not setting the RGMII delays on the platforms that imply it' being done on the PHY side will consequently cause the traffic loss. We discovered that the denoted soft-reset is missing in the m88e1121_config_aneg() method for the case if the RGMII delays are modified but the MDIx polarity isn't changed or the auto-negotiation is left enabled, thus causing the traffic loss on our platform with Marvell Alaska 88E1510 installed. Let's fix that by issuing the soft-reset if the delays have been actually set in the m88e1121_config_aneg_rgmii_delays() method. Cc: stable@vger.kernel.org Fixes: d6ab933 ("net: phy: marvell: Avoid unnecessary soft reset") Signed-off-by: Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Link: https://lore.kernel.org/r/20220205203932.26899-1-Pavel.Parkhomenko@baikalelectronics.ru Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 94fdd7c commit fe4f57b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/phy/marvell.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev)
553553
else
554554
mscr = 0;
555555

556-
return phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE,
557-
MII_88E1121_PHY_MSCR_REG,
558-
MII_88E1121_PHY_MSCR_DELAY_MASK, mscr);
556+
return phy_modify_paged_changed(phydev, MII_MARVELL_MSCR_PAGE,
557+
MII_88E1121_PHY_MSCR_REG,
558+
MII_88E1121_PHY_MSCR_DELAY_MASK, mscr);
559559
}
560560

561561
static int m88e1121_config_aneg(struct phy_device *phydev)
@@ -569,11 +569,13 @@ static int m88e1121_config_aneg(struct phy_device *phydev)
569569
return err;
570570
}
571571

572+
changed = err;
573+
572574
err = marvell_set_polarity(phydev, phydev->mdix_ctrl);
573575
if (err < 0)
574576
return err;
575577

576-
changed = err;
578+
changed |= err;
577579

578580
err = genphy_config_aneg(phydev);
579581
if (err < 0)

0 commit comments

Comments
 (0)