Fix bogus warning in sysdev_driver_register()
[pandora-kernel.git] / kernel / marker.c
index 041c33e..b5a9fe1 100644 (file)
 #include <linux/rcupdate.h>
 #include <linux/marker.h>
 #include <linux/err.h>
+#include <linux/slab.h>
 
 extern struct marker __start___markers[];
 extern struct marker __stop___markers[];
 
 /* Set to 1 to enable marker debug output */
-const int marker_debug;
+static const int marker_debug;
 
 /*
  * markers_mutex nests inside module_mutex. Markers mutex protects the builtin
@@ -671,6 +672,9 @@ int marker_probe_register(const char *name, const char *format,
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+       synchronize_sched();    /* Until we have the call_rcu_sched() */
+#endif
        call_rcu(&entry->rcu, free_old_closure);
 end:
        mutex_unlock(&markers_mutex);
@@ -714,6 +718,9 @@ int marker_probe_unregister(const char *name,
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+       synchronize_sched();    /* Until we have the call_rcu_sched() */
+#endif
        call_rcu(&entry->rcu, free_old_closure);
        remove_marker(name);    /* Ignore busy error message */
        ret = 0;
@@ -792,6 +799,9 @@ int marker_probe_unregister_private_data(marker_probe_func *probe,
        entry->rcu_pending = 1;
        /* write rcu_pending before calling the RCU callback */
        smp_wmb();
+#ifdef CONFIG_PREEMPT_RCU
+       synchronize_sched();    /* Until we have the call_rcu_sched() */
+#endif
        call_rcu(&entry->rcu, free_old_closure);
        remove_marker(entry->name);     /* Ignore busy error message */
 end: