net: phy: dp83869: fix default value for tx-/rx-internal-delay
authorJosua Mayer <josua@solid-run.com>
Thu, 23 Mar 2023 10:25:36 +0000 (12:25 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 24 Mar 2023 21:52:35 +0000 (14:52 -0700)
commit82e2c39f9ef78896e9b634dfd82dc042e6956bb7
tree754e088611906fade9f1acb750f6a7be9f45d3da
parentca4a80e4bb7e87daf33b27d2ab9e4f5311018a89
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: stable@vger.kernel.org
Fixes: 736b25afe284 ("net: dp83869: Add RGMII internal delay configuration")
Co-developed-by: Yazan Shhady <yazan.shhady@solid-run.com>
Signed-off-by: Yazan Shhady <yazan.shhady@solid-run.com>
Signed-off-by: Josua Mayer <josua@solid-run.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230323102536.31988-1-josua@solid-run.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/dp83869.c