]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mlx4_core: resolvs kernel panic when connectx_port_config fail to set ports
authorMoshe Lazer <moshel@mellanox.com>
Sun, 16 Jun 2013 08:04:17 +0000 (11:04 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 7 Jul 2015 21:45:11 +0000 (14:45 -0700)
When changing ports configutation (e.g. from ib,ib to eth,eth)
the device is disconnected from interfaces and catas error lists
than we change ports config and reconnecting the device.
In case ports config changing fails the device left disconnected.
If we try again to configure the ports the driver retry to
disconnect the device form its lists and crashes in list_del
function.  To aviod this the list_del replaced by list_del_init
(to allow redeleting the device).

Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
drivers/net/ethernet/mellanox/mlx4/intf.c
drivers/net/ethernet/mellanox/mlx4/main.c

index 6fce58718837202bd82739dd8592b753ece7ef42..2fdf685f2df59b3584862b798cf1cc94e7708f9f 100644 (file)
@@ -214,7 +214,7 @@ void mlx4_unregister_device(struct mlx4_dev *dev)
        list_for_each_entry(intf, &intf_list, list)
                mlx4_remove_device(intf, priv);
 
-       list_del(&priv->dev_list);
+       list_del_init(&priv->dev_list);
        dev->persist->interface_state &= ~MLX4_INTERFACE_STATE_UP;
 
        mutex_unlock(&intf_mutex);
index 49f154375cbc6875a170395f8f78c5a17fc260da..347779bf5c60fd0f64243d6cd1bd7ce35f211f78 100644 (file)
@@ -2894,6 +2894,7 @@ static int mlx4_load_one(struct pci_dev *pdev, int pci_dev_data,
 
        dev = &priv->dev;
 
+       INIT_LIST_HEAD(&priv->dev_list);
        INIT_LIST_HEAD(&priv->ctx_list);
        spin_lock_init(&priv->ctx_lock);