diff options
author | Daniel Golle <daniel@makrotopia.org> | 2022-09-09 05:00:57 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-09-09 05:04:32 +0100 |
commit | 3020d9f8b4d6651662ed22cc87e542ca3e66b887 (patch) | |
tree | 2cec458f71594fd247348b5dad756ce5ea2505a3 | |
parent | 545c6113c93bbf7de1b0e515141a4565f7e6cece (diff) | |
download | upstream-3020d9f8b4d6651662ed22cc87e542ca3e66b887.tar.gz upstream-3020d9f8b4d6651662ed22cc87e542ca3e66b887.tar.bz2 upstream-3020d9f8b4d6651662ed22cc87e542ca3e66b887.zip |
kernel: mtk_sgmii: re-organize PCS link status reporting
Don't report speed in case link is down.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r-- | target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch index 896f0169d2..cd97706658 100644 --- a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch +++ b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org> --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c -@@ -122,10 +122,26 @@ static void mtk_pcs_link_up(struct phyli +@@ -122,10 +122,28 @@ static void mtk_pcs_link_up(struct phyli regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val); } @@ -24,12 +24,14 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org> + struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs); + unsigned int val; + -+ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); -+ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; -+ + regmap_read(mpcs->regmap, SGMSYS_PCS_CONTROL_1, &val); + state->an_complete = !!(val & SGMII_AN_COMPLETE); + state->link = !!(val & SGMII_LINK_STATYS); ++ if (!state->link) ++ return; ++ ++ regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val); ++ state->speed = val & RG_PHY_SPEED_3_125G ? SPEED_2500 : SPEED_1000; + state->duplex = DUPLEX_FULL; + state->pause = 0; +} |