Skip to contentSkip to conversation

Patch "mlxsw: pci: Wait after reset before accessing HW" has been added to the 4.14-stable tree

PATCH [email protected] 1 participant 1 message Feb 28, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mlxsw: pci: Wait after reset before accessing HW

to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mlxsw-pci-wait-after-reset-before-accessing-hw.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Wed Feb 28 16:23:28 CET 2018

From: Yuval Mintz <[email protected]>
Date: Wed, 10 Jan 2018 11:42:43 +0100
Subject: mlxsw: pci: Wait after reset before accessing HW

From: Yuval Mintz <[email protected]>

[ Upstream commit 8e033a93b37f37aa9fca71a370a895155320af60 ]

After performing reset driver polls on HW indication until learning that the reset is done, but immediately after reset the device becomes unresponsive which might lead to completion timeout on the first read.

Wait for 100ms before starting the polling.

Fixes 233fa44bd67a ("mlxsw: pci: Implement reset done check")
---
 drivers/net/ethernet/mellanox/mlxsw/pci.c    |    7 ++++++-
 drivers/net/ethernet/mellanox/mlxsw/pci_hw.h |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/pci.c +6 -1
@@ -1643,7 +1643,12 @@ static int mlxsw_pci_sw_reset(struct mlx
 		return 0;
 	}
 
-	wmb(); /* reset needs to be written before we read control register */
+	/* Reset needs to be written before we read control register, and
+	 * we must wait for the HW to become responsive once again
+	 */
+	wmb();
+	msleep(MLXSW_PCI_SW_RESET_WAIT_MSECS);
+
 	end = jiffies + msecs_to_jiffies(MLXSW_PCI_SW_RESET_TIMEOUT_MSECS);
 	do {
 		u32 val = mlxsw_pci_read32(mlxsw_pci, FW_READY);
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 -0
@@ -59,6 +59,7 @@
 #define MLXSW_PCI_SW_RESET			0xF0010
 #define MLXSW_PCI_SW_RESET_RST_BIT		BIT(0)
 #define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS	5000
+#define MLXSW_PCI_SW_RESET_WAIT_MSECS		100
 #define MLXSW_PCI_FW_READY			0xA1844
 #define MLXSW_PCI_FW_READY_MASK			0xFFFF
 #define MLXSW_PCI_FW_READY_MAGIC		0x5E

Patches currently in stable-queue which might be from [email protected] are

queue-4.14/mlxsw-pci-wait-after-reset-before-accessing-hw.patch