Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[platform/kernel/linux-rpi.git] / drivers / net / ethernet / mellanox / mlx5 / core / main.c
index 4870a88..89b2d9c 100644 (file)
@@ -1549,7 +1549,9 @@ int mlx5_mdev_init(struct mlx5_core_dev *dev, int profile_idx)
        memcpy(&dev->profile, &profile[profile_idx], sizeof(dev->profile));
        INIT_LIST_HEAD(&priv->ctx_list);
        spin_lock_init(&priv->ctx_lock);
+       lockdep_register_key(&dev->lock_key);
        mutex_init(&dev->intf_state_mutex);
+       lockdep_set_class(&dev->intf_state_mutex, &dev->lock_key);
 
        mutex_init(&priv->bfregs.reg_head.lock);
        mutex_init(&priv->bfregs.wc_head.lock);
@@ -1616,6 +1618,7 @@ err_timeout_init:
        mutex_destroy(&priv->bfregs.wc_head.lock);
        mutex_destroy(&priv->bfregs.reg_head.lock);
        mutex_destroy(&dev->intf_state_mutex);
+       lockdep_unregister_key(&dev->lock_key);
        return err;
 }
 
@@ -1637,6 +1640,7 @@ void mlx5_mdev_uninit(struct mlx5_core_dev *dev)
        mutex_destroy(&priv->bfregs.wc_head.lock);
        mutex_destroy(&priv->bfregs.reg_head.lock);
        mutex_destroy(&dev->intf_state_mutex);
+       lockdep_unregister_key(&dev->lock_key);
 }
 
 static int probe_one(struct pci_dev *pdev, const struct pci_device_id *id)