diff mbox series

[SRU,F:linux-bluefield,v1,1/1] UBUNTU: SAUCE: mlxbf-gige: OOB PHY stuck in a bad state during reboot test

Message ID 20240523172503.1746-2-asmaa@nvidia.com
State New
Headers show
Series UBUNTU: SAUCE: mlxbf-gige: Vitesse PHY stuck in a bad state during reboot test | expand

Commit Message

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

During the reboot test, the BF3 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.
Since the UEFI OOB driver doesn't have the issue, we mimic its
behavior in the ExitServices() routine by disabling the OOB port.
Although the PHY issue only happens in BF3, disabling the OOB port
in the shutdown is a fix that should apply to BF2 as well.

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 635009a209d5..c5f658d553e9 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -216,8 +216,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);