
From: Zizhi Wo <wozizhi@huawei.com> hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT -------------------------------- Architecture s390 did not define arch_test_bit_acquire() implementation, thus the compilation will fail. This patch has carried the function implementation to fix this problem. The mainline patch to fix this problem is d6ffe6067a54 ("provide arch_test_bit_acquire for architectures that define test_bit"), but due to a large adaptation conflicts, we came up with a patch of own. Fixes: 8238b4579866 ("wait_on_bit: add an acquire memory barrier") Signed-off-by: Zizhi Wo <wozizhi@huawei.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> --- arch/s390/include/asm/bitops.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index 431e208a5ea4..caf8099bd955 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h @@ -241,6 +241,13 @@ static inline void arch___clear_bit_unlock(unsigned long nr, arch___clear_bit(nr, ptr); } +static __always_inline bool +arch_test_bit_acquire(unsigned long nr, const volatile unsigned long *addr) +{ + unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr); + return 1UL & (smp_load_acquire(p) >> (nr & (BITS_PER_LONG-1))); +} + #include <asm-generic/bitops/instrumented-atomic.h> #include <asm-generic/bitops/instrumented-non-atomic.h> #include <asm-generic/bitops/instrumented-lock.h> -- 2.46.1