Browse Source

[IrDA]: irda lockdep annotation

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>
Samuel Ortiz 18 năm trước cách đây
mục cha
commit
c7630a4b93
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      net/irda/irqueue.c

+ 8 - 1
net/irda/irqueue.c

@@ -384,6 +384,9 @@ EXPORT_SYMBOL(hashbin_new);
  *    for deallocating this structure if it's complex. If not the user can
  *    for deallocating this structure if it's complex. If not the user can
  *    just supply kfree, which should take care of the job.
  *    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)
 int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 {
 {
 	irda_queue_t* queue;
 	irda_queue_t* queue;
@@ -395,7 +398,8 @@ int hashbin_delete( hashbin_t* hashbin, FREE_FUNC free_func)
 
 
 	/* Synchronize */
 	/* Synchronize */
 	if ( hashbin->hb_type & HB_LOCK ) {
 	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 */
 	/* Release lock */
 	if ( hashbin->hb_type & HB_LOCK) {
 	if ( hashbin->hb_type & HB_LOCK) {
 		spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
 		spin_unlock_irqrestore(&hashbin->hb_spinlock, flags);
+#ifdef CONFIG_LOCKDEP
+		hashbin_lock_depth--;
+#endif
 	}
 	}
 
 
 	/*
 	/*