Skip to contentSkip to conversation

Patch "frv: add atomic64_add_unless()" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Jun 15, 2017

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

frv: add atomic64_add_unless()

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
frv-add-atomic64_add_unless.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Thu Jun 15 16:23:30 CEST 2017

From: Sudip Mukherjee <[email protected]>
Date: Tue, 24 Jan 2017 15:18:21 -0800
Subject: frv: add atomic64_add_unless()

From: Sudip Mukherjee <[email protected]>

[ Upstream commit 545d58f677b21401f6de1ac12c25cc109f903ace ]

The build of frv allmodconfig was failing with the error:
lib/atomic64_test.c:209:9: error:

implicit declaration of function 'atomic64_add_unless'

All the atomic64 operations were defined in frv, but atomic64_add_unless() was not done.

Implement atomic64_add_unless() as done in other arches.

---
 arch/frv/include/asm/atomic.h |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/frv/include/asm/atomic.h +16 -0
@@ -161,6 +161,22 @@ static __inline__ int __atomic_add_unles
 	return c;
 }
 
+static inline int atomic64_add_unless(atomic64_t *v, long long i, long long u)
+{
+	long long c, old;
+
+	c = atomic64_read(v);
+	for (;;) {
+		if (unlikely(c == u))
+			break;
+		old = atomic64_cmpxchg(v, c, c + i);
+		if (likely(old == c))
+			break;
+		c = old;
+	}
+	return c != u;
+}
+
 #define ATOMIC_OP(op)							\
 static inline int atomic_fetch_##op(int i, atomic_t *v)			\
 {									\

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/frv-add-missing-atomic64-operations.patch queue-4.9/frv-add-atomic64_add_unless.patch