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

    IB/mlx4: Fix spinlock order to avoid lockdep warnings

to the 3.7-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:
     ib-mlx4-fix-spinlock-order-to-avoid-lockdep-warnings.patch
and it can be found in the queue-3.7 subdirectory.

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


>From ceb7decb366591e9b67d70832e07f5d240572a3d Mon Sep 17 00:00:00 2001
From: Jack Morgenstein <[email protected]>
Date: Tue, 27 Nov 2012 16:24:29 +0000
Subject: IB/mlx4: Fix spinlock order to avoid lockdep warnings

From: Jack Morgenstein <[email protected]>

commit ceb7decb366591e9b67d70832e07f5d240572a3d upstream.

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 <[email protected]>
Signed-off-by: Or Gerlitz <[email protected]>
Signed-off-by: Roland Dreier <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/infiniband/hw/mlx4/cm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/infiniband/hw/mlx4/cm.c
+++ b/drivers/infiniband/hw/mlx4/cm.c
@@ -268,15 +268,15 @@ static void schedule_delayed(struct ib_d
        struct mlx4_ib_sriov *sriov = &to_mdev(ibdev)->sriov;
        unsigned long flags;
 
-       spin_lock_irqsave(&sriov->going_down_lock, flags);
        spin_lock(&sriov->id_map_lock);
+       spin_lock_irqsave(&sriov->going_down_lock, flags);
        /*make sure that there is no schedule inside the scheduled work.*/
        if (!sriov->is_going_down) {
                id->scheduled_delete = 1;
                schedule_delayed_work(&id->timeout, CM_CLEANUP_CACHE_TIMEOUT);
        }
-       spin_unlock(&sriov->id_map_lock);
        spin_unlock_irqrestore(&sriov->going_down_lock, flags);
+       spin_unlock(&sriov->id_map_lock);
 }
 
 int mlx4_ib_multiplex_cm_handler(struct ib_device *ibdev, int port, int 
slave_id,


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

queue-3.7/ib-mlx4-fix-spinlock-order-to-avoid-lockdep-warnings.patch
queue-3.7/mlx4_core-fix-potential-deadlock-in-mlx4_eq_int.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to