All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Rich Felker <dalias@libc.org>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: linux-next: manual merge of the tip tree with the sh tree
Date: Sun, 24 Jul 2016 15:13:42 +1000	[thread overview]
Message-ID: <20160724151342.32b35c80@canb.auug.org.au> (raw)

Hi all,

Today's linux-next merge of the tip tree got a conflict in:

  arch/sh/include/asm/spinlock.h

between commit:

  2da83dfce7df ("sh: add J2 atomics using the cas.l instruction")

from the sh tree and commit:

  726328d92a42 ("locking/spinlock, arch: Update and fix spin_unlock_wait() implementations")

from the tip tree.

I fixed it up (I used this file from the sh tree and then added the merge
fix patch below) and can carry the fix as necessary. This is now fixed
as far as linux-next is concerned, but any non trivial conflicts should
be mentioned to your upstream maintainer when your tree is submitted for
merging.  You may also want to consider cooperating with the maintainer
of the conflicting tree to minimise any particularly complex conflicts.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Sun, 24 Jul 2016 15:09:57 +1000
Subject: [PATCH] locking/spinlock, arch: merge fix for "sh: add J2 atomics
 using the cas.l instruction"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/sh/include/asm/spinlock-cas.h  | 10 ++++++++--
 arch/sh/include/asm/spinlock-llsc.h | 10 ++++++++--
 2 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/arch/sh/include/asm/spinlock-cas.h b/arch/sh/include/asm/spinlock-cas.h
index a2a7c10b30d9..c46e8cc7b515 100644
--- a/arch/sh/include/asm/spinlock-cas.h
+++ b/arch/sh/include/asm/spinlock-cas.h
@@ -10,6 +10,9 @@
 #ifndef __ASM_SH_SPINLOCK_CAS_H
 #define __ASM_SH_SPINLOCK_CAS_H
 
+#include <asm/barrier.h>
+#include <asm/processor.h>
+
 static inline unsigned __sl_cas(volatile unsigned *p, unsigned old, unsigned new)
 {
 	__asm__ __volatile__("cas.l %1,%0,@r0"
@@ -25,8 +28,11 @@ static inline unsigned __sl_cas(volatile unsigned *p, unsigned old, unsigned new
 
 #define arch_spin_is_locked(x)		((x)->lock <= 0)
 #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
-#define arch_spin_unlock_wait(x) \
-	do { while (arch_spin_is_locked(x)) cpu_relax(); } while (0)
+
+static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
+{
+	smp_cond_load_acquire(&lock->lock, VAL > 0);
+}
 
 static inline void arch_spin_lock(arch_spinlock_t *lock)
 {
diff --git a/arch/sh/include/asm/spinlock-llsc.h b/arch/sh/include/asm/spinlock-llsc.h
index 238ef6f54dcc..cec78143fa83 100644
--- a/arch/sh/include/asm/spinlock-llsc.h
+++ b/arch/sh/include/asm/spinlock-llsc.h
@@ -11,14 +11,20 @@
 #ifndef __ASM_SH_SPINLOCK_LLSC_H
 #define __ASM_SH_SPINLOCK_LLSC_H
 
+#include <asm/barrier.h>
+#include <asm/processor.h>
+
 /*
  * Your basic SMP spinlocks, allowing only a single CPU anywhere
  */
 
 #define arch_spin_is_locked(x)		((x)->lock <= 0)
 #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
-#define arch_spin_unlock_wait(x) \
-	do { while (arch_spin_is_locked(x)) cpu_relax(); } while (0)
+
+static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
+{
+	smp_cond_load_acquire(&lock->lock, VAL > 0);
+}
 
 /*
  * Simple spin lock operations.  There are two variants, one clears IRQ's
-- 
2.8.1

-- 
Cheers,
Stephen Rothwell

             reply	other threads:[~2016-07-24  5:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24  5:13 Stephen Rothwell [this message]
2016-07-25  3:55 ` linux-next: manual merge of the tip tree with the sh tree Rich Felker
2016-07-25  4:16   ` Stephen Rothwell
2016-07-25 22:30 ` Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2010-10-14  2:19 Stephen Rothwell
2010-07-28  4:35 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160724151342.32b35c80@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=dalias@libc.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.