]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/lockdep.c
sis190: scheduling while atomic error
[linux-2.6-omap-h63xx.git] / kernel / lockdep.c
index 0f389621bb6b42d803224db0f85d161a7c95188c..4335f12a27c6367e8e264a1128050ea3df6e8415 100644 (file)
@@ -2654,10 +2654,15 @@ static void check_flags(unsigned long flags)
        if (!debug_locks)
                return;
 
-       if (irqs_disabled_flags(flags))
-               DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled);
-       else
-               DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled);
+       if (irqs_disabled_flags(flags)) {
+               if (DEBUG_LOCKS_WARN_ON(current->hardirqs_enabled)) {
+                       printk("possible reason: unannotated irqs-off.\n");
+               }
+       } else {
+               if (DEBUG_LOCKS_WARN_ON(!current->hardirqs_enabled)) {
+                       printk("possible reason: unannotated irqs-on.\n");
+               }
+       }
 
        /*
         * We dont accurately track softirq state in e.g.
@@ -2938,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size)
        struct list_head *head;
        unsigned long flags;
        int i;
+       int locked;
 
        raw_local_irq_save(flags);
-       graph_lock();
+       locked = graph_lock();
 
        /*
         * Unhash all classes that were created by this module:
@@ -2954,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size)
                                zap_class(class);
        }
 
-       graph_unlock();
+       if (locked)
+               graph_unlock();
        raw_local_irq_restore(flags);
 }
 
@@ -2964,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
        struct list_head *head;
        unsigned long flags;
        int i, j;
+       int locked;
 
        raw_local_irq_save(flags);
 
@@ -2982,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
         * Debug check: in the end all mapped classes should
         * be gone.
         */
-       graph_lock();
+       locked = graph_lock();
        for (i = 0; i < CLASSHASH_SIZE; i++) {
                head = classhash_table + i;
                if (list_empty(head))
@@ -2995,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock)
                        }
                }
        }
-       graph_unlock();
+       if (locked)
+               graph_unlock();
 
 out_restore:
        raw_local_irq_restore(flags);