ARM: 7495/1: mutex: use generic atomic_dec-based implementation for ARMv6+
[firefly-linux-kernel-4.4.55.git] / arch / arm / include / asm / mutex.h
index b1479fd04a951f1d82d55f77fd01cb9f0b072f38..87c044910fe0a2274cc7198cdcbe00ca76d05795 100644 (file)
@@ -9,8 +9,13 @@
 #define _ASM_MUTEX_H
 /*
  * On pre-ARMv6 hardware this results in a swp-based implementation,
- * which is the most efficient. For ARMv6+, we emit a pair of exclusive
- * accesses instead.
+ * which is the most efficient. For ARMv6+, we have exclusive memory
+ * accessors and use atomic_dec to avoid the extra xchg operations
+ * on the locking slowpaths.
  */
+#if __LINUX_ARM_ARCH__ < 6
 #include <asm-generic/mutex-xchg.h>
+#else
+#include <asm-generic/mutex-dec.h>
 #endif
+#endif /* _ASM_MUTEX_H */