diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2012-11-27 11:24:29 -0500 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2012-11-29 15:14:45 -0500 |
commit | ceb7decb366591e9b67d70832e07f5d240572a3d (patch) | |
tree | 5fb1789536cde94d2b616c1fb46f9b5a66dd492f /drivers/infiniband | |
parent | 08ff32352d6ff7083533dc1c25618d42f92ec28e (diff) |
IB/mlx4: Fix spinlock order to avoid lockdep warnings
lockdep warns about taking a hard-irq-unsafe lock (sriov->id_map_lock)
inside a hard-irq-safe lock (sriov->going_down_lock).
Since id_map_lock is never taken in the interrupt context, we can
simply reverse the order of taking the two spinlocks, thus avoiding
the warning and the depencency.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/mlx4/cm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mlx4/cm.c b/drivers/infiniband/hw/mlx4/cm.c index 80079e5a2e30..dbc99d41605c 100644 --- a/drivers/infiniband/hw/mlx4/cm.c +++ b/drivers/infiniband/hw/mlx4/cm.c | |||
@@ -268,15 +268,15 @@ static void schedule_delayed(struct ib_device *ibdev, struct id_map_entry *id) | |||
268 | struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; | 268 | struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov; |
269 | unsigned long flags; | 269 | unsigned long flags; |
270 | 270 | ||
271 | spin_lock_irqsave(&sriov->going_down_lock, flags); | ||
272 | spin_lock(&sriov->id_map_lock); | 271 | spin_lock(&sriov->id_map_lock); |
272 | spin_lock_irqsave(&sriov->going_down_lock, flags); | ||
273 | /*make sure that there is no schedule inside the scheduled work.*/ | 273 | /*make sure that there is no schedule inside the scheduled work.*/ |
274 | if (!sriov->is_going_down) { | 274 | if (!sriov->is_going_down) { |
275 | id->scheduled_delete = 1; | 275 | id->scheduled_delete = 1; |
276 | schedule_delayed_work(&id->timeout, CM_CLEANUP_CACHE_TIMEOUT); | 276 | schedule_delayed_work(&id->timeout, CM_CLEANUP_CACHE_TIMEOUT); |
277 | } | 277 | } |
278 | spin_unlock(&sriov->id_map_lock); | ||
279 | spin_unlock_irqrestore(&sriov->going_down_lock, flags); | 278 | spin_unlock_irqrestore(&sriov->going_down_lock, flags); |
279 | spin_unlock(&sriov->id_map_lock); | ||
280 | } | 280 | } |
281 | 281 | ||
282 | int mlx4_ib_multiplex_cm_handler(struct ib_device *ibdev, int port, int slave_id, | 282 | int mlx4_ib_multiplex_cm_handler(struct ib_device *ibdev, int port, int slave_id, |