]> err.no Git - linux-2.6/commitdiff
[IrDA]: irda lockdep annotation
authorSamuel Ortiz <samuel@sortiz.org>
Sat, 17 Mar 2007 03:38:23 +0000 (20:38 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:26:23 +0000 (22:26 -0700)
Rmmoding irda triggers a lockdep false positive.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/irda/irqueue.c

index 92662330dbcf0aee2bf1b7e0fc557ef36a64895e..d058b467f9e450e7c2f1a331a3be18298c8c61ec 100644 (file)
@@ -384,6 +384,9 @@ EXPORT_SYMBOL(hashbin_new);
  *    for deallocating this structure if it's complex. If not the user can
  *    just supply kfree, which should take care of the job.
  */
+#ifdef CONFIG_LOCKDEP
+static int hashbin_lock_depth = 0;
+#endif
 int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 {
        irda_queue_t* queue;
@@ -395,7 +398,8 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 
        /* Synchronize */
        if ( hashbin->hb_type & HB_LOCK ) {
-               spin_lock_irqsave(&hashbin->hb_spinlock, flags);
+               spin_lock_irqsave_nested(&hashbin->hb_spinlock, flags,
+                                        hashbin_lock_depth++);
        }
 
        /*
@@ -419,6 +423,9 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
        /* Release lock */
        if ( hashbin->hb_type & HB_LOCK) {
                spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
+#ifdef CONFIG_LOCKDEP
+               hashbin_lock_depth--;
+#endif
        }
 
        /*