diff mbox series

[SRU,J:linux-bluefield,v2,1/1] UBUNTU: SAUCE: mlxbf-gige: Vitesse PHY stuck in a bad state during reboot test

Message ID 20240514175957.2390-2-asmaa@nvidia.com
State New
Headers show
Series [SRU,J:linux-bluefield,v2,1/1] UBUNTU: SAUCE: mlxbf-gige: Vitesse PHY stuck in a bad state during reboot test | expand

Commit Message

Asmaa Mnebhi May 14, 2024, 5:59 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2064163

During the reboot test, the OOB doesn't get an ip. The root cause
is the PHY getting stuck in a bad state that's only recoverable by
a PHY hard reset so a powercycle. Warm boot doesn't support this
capability.
We can avoid this bug by preventing the PHY from entering this
bad state in the first place.
Disabling the OOB port avoids the issue.

Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Reviewed-by: David Thompson <davthompson@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 56235cef5cd6..006c2b4eee70 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -202,8 +202,14 @@  static int mlxbf_gige_open(struct net_device *netdev)
 static int mlxbf_gige_stop(struct net_device *netdev)
 {
 	struct mlxbf_gige *priv = netdev_priv(netdev);
+	u64 control;
+
+	control = readq(priv->base + MLXBF_GIGE_CONTROL);
+	control &= ~MLXBF_GIGE_CONTROL_PORT_EN;
+	writeq(control, priv->base + MLXBF_GIGE_CONTROL);
 
 	writeq(0, priv->base + MLXBF_GIGE_INT_EN);
+	mb();
 	netif_stop_queue(netdev);
 	napi_disable(&priv->napi);
 	netif_napi_del(&priv->napi);