[PATCH] net: mvpp2: add delay at the end of .mac_prepare

Baruch Siach
2022-04-27T15:06:20Z

From: Baruch Siach <baruch.siach@siklu.com>

Without this delay PHY mode switch from XLG to SGMII fails in a weird
way. Rx side works. However, Tx appears to work as far as the MAC is
concerned, but packets don't show up on the wire.

Tested with Marvell 10G 88X3310 PHY.

Signed-off-by: Baruch Siach <baruch.siach@siklu.com>
---

Not sure this is the right fix. Let me know if you have any better
suggestion for me to test.

The same issue and fix reproduce with both v5.18-rc4 and v5.10.110.
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 1a835b48791b..8823efe396b1 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -6432,6 +6432,8 @@ static int mvpp2_mac_prepare(struct phylink_config *config, unsigned int mode,
}
}

+ mdelay(10);
+
return 0;
}

--
2.35.1