summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx4/main.c
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@mellanox.com>2015-01-25 16:59:38 +0200
committerDavid S. Miller <davem@davemloft.net>2015-01-25 14:43:14 -0800
commitf6bc11e42646e661e699a5593cbd1e9dba7191d0 (patch)
tree184f01eb39d1c694b149b5b19bd6d06a86209a6f /drivers/net/ethernet/mellanox/mlx4/main.c
parentad9a0bf08ffbf32b8f292c3bb78ca0f24bb8f6b2 (diff)
downloadop-kernel-dev-f6bc11e42646e661e699a5593cbd1e9dba7191d0.zip
op-kernel-dev-f6bc11e42646e661e699a5593cbd1e9dba7191d0.tar.gz
net/mlx4_core: Enhance the catas flow to support device reset
This includes: - resetting the chip when a fatal error is detected (the current code does not do this). - exposing the ability to enter error state from outside the catas code by calling its functionality. (E.g. FW Command timeout, AER error). - managing a persistent device state. This is needed to sync between reset flow cases. Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/main.c')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c
index a61694c..dc2d910 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -2624,6 +2624,11 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
}
}
+ /* on load remove any previous indication of internal error,
+ * device is up.
+ */
+ dev->persist->state = MLX4_DEVICE_STATE_UP;
+
slave_start:
err = mlx4_cmd_init(dev);
if (err) {
@@ -3108,6 +3113,7 @@ static int mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
dev->persist->dev = dev;
pci_set_drvdata(pdev, dev->persist);
priv->pci_dev_data = id->driver_data;
+ mutex_init(&dev->persist->device_state_mutex);
ret = __mlx4_init_one(pdev, id->driver_data, priv);
if (ret) {
OpenPOWER on IntegriCloud