+static __inline__ long atomic64_dec_if_positive(atomic64_t *v)
+{
+ long c, old, dec;
+ c = atomic64_read(v);
+ for (;;) {
+ dec = c - 1;
+ if (unlikely(dec < 0))
+ break;
+ old = atomic64_cmpxchg((v), c, dec);
+
This came to light when implementing native 64-bit atomics for ARCv2.
The atomic64 self-test code uses CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
to check whether atomic64_dec_if_positive() is available.
It seems it was needed when not every arch defined it.
However as of current code the Kconfig op
Hi Peter / Tony.
Sorry for the rebase snafu with v2.
So kbuild service reported build failure of ia64 with v1 of the patch.
I've added an untested atomic64_dec_if_positive() to ia64, shamelessly
copied from s390 with some adjustments 64-bit long etc. Could you please
double check.
It builds fine
This is based on s390 version and needed to get rid of
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: linux-i...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Reported-by: kbuild test robot
Signed-off-by: Vineet Gupta
---
arch
This came to light when implementing native 64-bit atomics for ARCv2.
The atomic64 self-test code uses CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
to check whether atomic64_dec_if_positive() is available.
It seems it was needed when not every arch defined it.
However as of current code the Kconfig op
Hi Peter / Tony.
So kbuild service reported build failure of ia64 with my prev patch.
I've added an untested atomic64_dec_if_positive() to ia64, shamelessly
copied from s390 with some adjustments 64-bit long etc. Could you please
double check.
It builds fine with ia64 cross compiler.
Thx,
-Vinee
This is based on s390 version and needed to get rid of
CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
Cc: Tony Luck
Cc: Fenghua Yu
Cc: Ingo Molnar
Cc: Peter Zijlstra
Cc: linux-i...@vger.kernel.org
Cc: linux-ker...@vger.kernel.org
Signed-off-by: Vineet Gupta
---
arch/ia64/include/asm/atomic.h | 16
In the end of "arc_init_IRQ" STATUS32.IE flag is going to be affected by
"flag" instruction but "flag" never touches IE flag on ARCv2. So "kflag"
instruction must be used instead of "flag".
Signed-off-by: Yuriy Kolerov
---
arch/arc/kernel/intc-arcv2.c | 2 +-
1 file changed, 1 insertion(+), 1 de