From e7ee74598b987fdc702614668b7ea85884289cf1 Mon Sep 17 00:00:00 2001 From: Shawn Webb Date: Wed, 5 Aug 2020 09:33:17 -0400 Subject: [PATCH] HBSD: Properly perform the write memory barrier As reported by Alan Cox, Emmanuel Vadot's use and placing of wmb() was incorrect. Use the more appropriate function atomic_thread_fence_rel() at the more appropriate place. Signed-off-by: Shawn Webb --- sys/compat/linuxkpi/common/include/linux/bitops.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h index 7e259760f7c3ac..64b0ca57a7c733 100644 --- a/sys/compat/linuxkpi/common/include/linux/bitops.h +++ b/sys/compat/linuxkpi/common/include/linux/bitops.h @@ -278,8 +278,8 @@ find_next_zero_bit(const unsigned long *addr, unsigned long size, static inline void clear_bit_unlock(long bit, volatile unsigned long *var) { + atomic_thread_fence_rel(); clear_bit(bit, var); - wmb(); } static inline int