Commit af591e2b authored by Josua Mayer's avatar Josua Mayer Committed by sanglipeng
Browse files

net: phy: dp83869: fix default value for tx-/rx-internal-delay

stable inclusion
from stable-v5.10.177
commit fbf3fe7f7bc3713ef191c1edcc30a46e90c1ea09
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I88YNP

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=fbf3fe7f7bc3713ef191c1edcc30a46e90c1ea09



--------------------------------

commit 82e2c39f upstream.

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: 736b25af ("net: dp83869: Add RGMII internal delay configuration")
Co-developed-by: default avatarYazan Shhady <yazan.shhady@solid-run.com>
Signed-off-by: default avatarYazan Shhady <yazan.shhady@solid-run.com>
Signed-off-by: default avatarJosua Mayer <josua@solid-run.com>
Reviewed-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230323102536.31988-1-josua@solid-run.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent e124650f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment