Skip to content

Commit 82e2c39

Browse files
Josua-SRkuba-moo
authored andcommitted
net: phy: dp83869: fix default value for tx-/rx-internal-delay
dp83869 internally uses a look-up table for mapping supported delays in nanoseconds to register values. When specific delays are defined in device-tree, phy_get_internal_delay does the lookup automatically returning an index. The default case wrongly assigns the nanoseconds value from the lookup table, resulting in numeric value 2000 applied to delay configuration register, rather than the expected index values 0-7 (7 for 2000). Ultimately this issue broke RX for 1Gbps links. Fix default delay configuration by assigning the intended index value directly. Cc: [email protected] Fixes: 736b25a ("net: dp83869: Add RGMII internal delay configuration") Co-developed-by: Yazan Shhady <[email protected]> Signed-off-by: Yazan Shhady <[email protected]> Signed-off-by: Josua Mayer <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ca4a80e commit 82e2c39

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/phy/dp83869.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,13 @@ static int dp83869_of_init(struct phy_device *phydev)
588588
&dp83869_internal_delay[0],
589589
delay_size, true);
590590
if (dp83869->rx_int_delay < 0)
591-
dp83869->rx_int_delay =
592-
dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
591+
dp83869->rx_int_delay = DP83869_CLK_DELAY_DEF;
593592

594593
dp83869->tx_int_delay = phy_get_internal_delay(phydev, dev,
595594
&dp83869_internal_delay[0],
596595
delay_size, false);
597596
if (dp83869->tx_int_delay < 0)
598-
dp83869->tx_int_delay =
599-
dp83869_internal_delay[DP83869_CLK_DELAY_DEF];
597+
dp83869->tx_int_delay = DP83869_CLK_DELAY_DEF;
600598

601599
return ret;
602600
}

0 commit comments

Comments
 (0)