diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 19:57:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-06 19:57:52 -0400 |
commit | dd4e5d6106b2380e2c1238406d26df8b2fe1c42c (patch) | |
tree | 33eb172237dd8873de02d5b881bf17cf58d05fab /kernel/locking/spinlock_debug.c | |
parent | 14be4c61c205dcb0a72251c1e2790814181bd9ba (diff) | |
parent | 9726840d9cf0d42377e1591263d7c1d9ae0988ac (diff) |
Merge tag 'arm64-mmiowb' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux
Pull mmiowb removal from Will Deacon:
"Remove Mysterious Macro Intended to Obscure Weird Behaviours (mmiowb())
Remove mmiowb() from the kernel memory barrier API and instead, for
architectures that need it, hide the barrier inside spin_unlock() when
MMIO has been performed inside the critical section.
The only relatively recent changes have been addressing review
comments on the documentation, which is in a much better shape thanks
to the efforts of Ben and Ingo.
I was initially planning to split this into two pull requests so that
you could run the coccinelle script yourself, however it's been plain
sailing in linux-next so I've just included the whole lot here to keep
things simple"
* tag 'arm64-mmiowb' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: (23 commits)
docs/memory-barriers.txt: Update I/O section to be clearer about CPU vs thread
docs/memory-barriers.txt: Fix style, spacing and grammar in I/O section
arch: Remove dummy mmiowb() definitions from arch code
net/ethernet/silan/sc92031: Remove stale comment about mmiowb()
i40iw: Redefine i40iw_mmiowb() to do nothing
scsi/qla1280: Remove stale comment about mmiowb()
drivers: Remove explicit invocations of mmiowb()
drivers: Remove useless trailing comments from mmiowb() invocations
Documentation: Kill all references to mmiowb()
riscv/mmiowb: Hook up mmwiob() implementation to asm-generic code
powerpc/mmiowb: Hook up mmwiob() implementation to asm-generic code
ia64/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
mips/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
sh/mmiowb: Add unconditional mmiowb() to arch_spin_unlock()
m68k/io: Remove useless definition of mmiowb()
nds32/io: Remove useless definition of mmiowb()
x86/io: Remove useless definition of mmiowb()
arm64/io: Remove useless definition of mmiowb()
ARM/io: Remove useless definition of mmiowb()
mmiowb: Hook up mmiowb helpers to spinlocks and generic I/O accessors
...
Diffstat (limited to 'kernel/locking/spinlock_debug.c')
-rw-r--r-- | kernel/locking/spinlock_debug.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c index 9aa0fccd5d43..399669f7eba8 100644 --- a/kernel/locking/spinlock_debug.c +++ b/kernel/locking/spinlock_debug.c | |||
@@ -111,6 +111,7 @@ void do_raw_spin_lock(raw_spinlock_t *lock) | |||
111 | { | 111 | { |
112 | debug_spin_lock_before(lock); | 112 | debug_spin_lock_before(lock); |
113 | arch_spin_lock(&lock->raw_lock); | 113 | arch_spin_lock(&lock->raw_lock); |
114 | mmiowb_spin_lock(); | ||
114 | debug_spin_lock_after(lock); | 115 | debug_spin_lock_after(lock); |
115 | } | 116 | } |
116 | 117 | ||
@@ -118,8 +119,10 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) | |||
118 | { | 119 | { |
119 | int ret = arch_spin_trylock(&lock->raw_lock); | 120 | int ret = arch_spin_trylock(&lock->raw_lock); |
120 | 121 | ||
121 | if (ret) | 122 | if (ret) { |
123 | mmiowb_spin_lock(); | ||
122 | debug_spin_lock_after(lock); | 124 | debug_spin_lock_after(lock); |
125 | } | ||
123 | #ifndef CONFIG_SMP | 126 | #ifndef CONFIG_SMP |
124 | /* | 127 | /* |
125 | * Must not happen on UP: | 128 | * Must not happen on UP: |
@@ -131,6 +134,7 @@ int do_raw_spin_trylock(raw_spinlock_t *lock) | |||
131 | 134 | ||
132 | void do_raw_spin_unlock(raw_spinlock_t *lock) | 135 | void do_raw_spin_unlock(raw_spinlock_t *lock) |
133 | { | 136 | { |
137 | mmiowb_spin_unlock(); | ||
134 | debug_spin_unlock(lock); | 138 | debug_spin_unlock(lock); |
135 | arch_spin_unlock(&lock->raw_lock); | 139 | arch_spin_unlock(&lock->raw_lock); |
136 | } | 140 | } |