Skip to content

Commit 528a08b

Browse files
vladimirolteankuba-moo
authored andcommitted
net: phy: mscc: fix packet loss due to RGMII delays
Two deadly typos break RX and TX traffic on the VSC8502 PHY using RGMII if phy-mode = "rgmii-id" or "rgmii-txid", and no "tx-internal-delay-ps" override exists. The negative error code from phy_get_internal_delay() does not get overridden with the delay deduced from the phy-mode, and later gets committed to hardware. Also, the rx_delay gets overridden by what should have been the tx_delay. Fixes: dbb050d ("phy: mscc: Add support for RGMII delay configuration") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Harini Katakam <harini.katakam@amd.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Link: https://lore.kernel.org/r/20230627134235.3453358-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent d9b1a5a commit 528a08b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/net/phy/mscc/mscc_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,9 +563,9 @@ static int vsc85xx_update_rgmii_cntl(struct phy_device *phydev, u32 rgmii_cntl,
563563
if (tx_delay < 0) {
564564
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
565565
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
566-
rx_delay = RGMII_CLK_DELAY_2_0_NS;
566+
tx_delay = RGMII_CLK_DELAY_2_0_NS;
567567
else
568-
rx_delay = RGMII_CLK_DELAY_0_2_NS;
568+
tx_delay = RGMII_CLK_DELAY_0_2_NS;
569569
}
570570

571571
reg_val |= rx_delay << rgmii_rx_delay_pos;

0 commit comments

Comments
 (0)