locking: Add an smp_mb__after_unlock_lock() for UNLOCK+BLOCK barrier
[firefly-linux-kernel-4.4.55.git] / include / linux / spinlock.h
index 75f34949d9ab998adf5941c0321ea45005cc7d62..3f2867ff0ced55086615610aa6807f80af042b08 100644 (file)
@@ -130,6 +130,16 @@ do {                                                               \
 #define smp_mb__before_spinlock()      smp_wmb()
 #endif
 
+/*
+ * Place this after a lock-acquisition primitive to guarantee that
+ * an UNLOCK+LOCK pair act as a full barrier.  This guarantee applies
+ * if the UNLOCK and LOCK are executed by the same CPU or if the
+ * UNLOCK and LOCK operate on the same lock variable.
+ */
+#ifndef smp_mb__after_unlock_lock
+#define smp_mb__after_unlock_lock()    do { } while (0)
+#endif
+
 /**
  * raw_spin_unlock_wait - wait until the spinlock gets unlocked
  * @lock: the spinlock in question.