RE: [PATCH v2 1/2] ia64: implement atomic64_dec_if_positive

2016-09-12 Thread Luck, Tony
+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); +

[PATCH v3 2/2] atomic64: No need for CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

2016-09-12 Thread Vineet Gupta
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

[PATCH v3 0/2] Getting rid of CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

2016-09-12 Thread Vineet Gupta
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

[PATCH v3 1/2] ia64: implement atomic64_dec_if_positive

2016-09-12 Thread Vineet Gupta
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

[PATCH v2 2/2] atomic64: No need for CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

2016-09-12 Thread Vineet Gupta
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

[PATCH v2 0/2] Getting rid of CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE

2016-09-12 Thread Vineet Gupta
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

[PATCH v2 1/2] ia64: implement atomic64_dec_if_positive

2016-09-12 Thread Vineet Gupta
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

[PATCH] ARCv2: intc: Use kflag if STATUS32.IE must be reset

2016-09-12 Thread Yuriy Kolerov
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