stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "sparc32: Add cmpxchg64()." has been added to the 4.14-stable tree
@ 2017-11-20 15:16 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-11-20 15:16 UTC (permalink / raw)
  To: davem, gregkh, linux; +Cc: stable, stable-commits


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

    sparc32: Add cmpxchg64().

to the 4.14-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:
     sparc32-add-cmpxchg64.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 23198ddffb6cddb5d5824230af4dd4b46e4046a4 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@davemloft.net>
Date: Wed, 27 Sep 2017 22:38:19 -0700
Subject: sparc32: Add cmpxchg64().

From: David S. Miller <davem@davemloft.net>

commit 23198ddffb6cddb5d5824230af4dd4b46e4046a4 upstream.

This fixes the build with i40e driver enabled.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/sparc/include/asm/cmpxchg_32.h |    3 +++
 arch/sparc/lib/atomic32.c           |   14 ++++++++++++++
 2 files changed, 17 insertions(+)

--- a/arch/sparc/include/asm/cmpxchg_32.h
+++ b/arch/sparc/include/asm/cmpxchg_32.h
@@ -63,6 +63,9 @@ __cmpxchg(volatile void *ptr, unsigned l
 			(unsigned long)_n_, sizeof(*(ptr)));		\
 })
 
+u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new);
+#define cmpxchg64(ptr, old, new)	__cmpxchg_u64(ptr, old, new)
+
 #include <asm-generic/cmpxchg-local.h>
 
 /*
--- a/arch/sparc/lib/atomic32.c
+++ b/arch/sparc/lib/atomic32.c
@@ -173,6 +173,20 @@ unsigned long __cmpxchg_u32(volatile u32
 }
 EXPORT_SYMBOL(__cmpxchg_u32);
 
+u64 __cmpxchg_u64(u64 *ptr, u64 old, u64 new)
+{
+	unsigned long flags;
+	u64 prev;
+
+	spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
+	if ((prev = *ptr) == old)
+		*ptr = new;
+	spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
+
+	return prev;
+}
+EXPORT_SYMBOL(__cmpxchg_u64);
+
 unsigned long __xchg_u32(volatile u32 *ptr, u32 new)
 {
 	unsigned long flags;


Patches currently in stable-queue which might be from davem@davemloft.net are

queue-4.14/sparc64-mmu_context-add-missing-include-files.patch
queue-4.14/sparc32-add-cmpxchg64.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-11-20 15:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 15:16 Patch "sparc32: Add cmpxchg64()." has been added to the 4.14-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).