lkml.org 
[lkml]   [2007]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 6/6] IrDA: Lockdep annotation for hashbin locks
Rmmoding irda triggers a lockdep false positive. We can fix that by assigning
each hashbin lock to a separate class.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Samuel Ortiz <samuel@sortiz.org>
---
include/net/irda/irqueue.h | 1 +
net/irda/irqueue.c | 1 +
2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/net/irda/irqueue.h b/include/net/irda/irqueue.h
index 335b0ac..67cb434 100644
--- a/include/net/irda/irqueue.h
+++ b/include/net/irda/irqueue.h
@@ -71,6 +71,7 @@ typedef struct hashbin_t {
int hb_size;
spinlock_t hb_spinlock; /* HB_LOCK - Can be used by the user */

+ struct lock_class_key hb_lock_key;
irda_queue_t* hb_queue[HASHBIN_SIZE] IRDA_ALIGN;

irda_queue_t* hb_current;
diff --git a/net/irda/irqueue.c b/net/irda/irqueue.c
index 9266233..2871a8a 100644
--- a/net/irda/irqueue.c
+++ b/net/irda/irqueue.c
@@ -370,6 +370,7 @@ hashbin_t *hashbin_new(int type)
/* Make sure all spinlock's are unlocked */
if ( hashbin->hb_type & HB_LOCK ) {
spin_lock_init(&hashbin->hb_spinlock);
+ lockdep_set_class(&hashbin->hb_spinlock, &hashbin->hb_lock_key);
}

return hashbin;
--
1.5.0.2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-14 20:35    [W:0.038 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site