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 ...
This commit is contained in:
@@ -113,20 +113,6 @@ extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
|
||||
*/
|
||||
#define __ia64_mf_a() ia64_mfa()
|
||||
|
||||
/**
|
||||
* ___ia64_mmiowb - I/O write barrier
|
||||
*
|
||||
* Ensure ordering of I/O space writes. This will make sure that writes
|
||||
* following the barrier will arrive after all previous writes. For most
|
||||
* ia64 platforms, this is a simple 'mf.a' instruction.
|
||||
*
|
||||
* See Documentation/driver-api/device-io.rst for more information.
|
||||
*/
|
||||
static inline void ___ia64_mmiowb(void)
|
||||
{
|
||||
ia64_mfa();
|
||||
}
|
||||
|
||||
static inline void*
|
||||
__ia64_mk_io_addr (unsigned long port)
|
||||
{
|
||||
@@ -161,7 +147,6 @@ __ia64_mk_io_addr (unsigned long port)
|
||||
#define __ia64_writew ___ia64_writew
|
||||
#define __ia64_writel ___ia64_writel
|
||||
#define __ia64_writeq ___ia64_writeq
|
||||
#define __ia64_mmiowb ___ia64_mmiowb
|
||||
|
||||
/*
|
||||
* For the in/out routines, we need to do "mf.a" _after_ doing the I/O access to ensure
|
||||
@@ -296,7 +281,6 @@ __outsl (unsigned long port, const void *src, unsigned long count)
|
||||
#define __outb platform_outb
|
||||
#define __outw platform_outw
|
||||
#define __outl platform_outl
|
||||
#define __mmiowb platform_mmiowb
|
||||
|
||||
#define inb(p) __inb(p)
|
||||
#define inw(p) __inw(p)
|
||||
@@ -310,7 +294,6 @@ __outsl (unsigned long port, const void *src, unsigned long count)
|
||||
#define outsb(p,s,c) __outsb(p,s,c)
|
||||
#define outsw(p,s,c) __outsw(p,s,c)
|
||||
#define outsl(p,s,c) __outsl(p,s,c)
|
||||
#define mmiowb() __mmiowb()
|
||||
|
||||
/*
|
||||
* The address passed to these functions are ioremap()ped already.
|
||||
|
25
arch/ia64/include/asm/mmiowb.h
Normal file
25
arch/ia64/include/asm/mmiowb.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
#ifndef _ASM_IA64_MMIOWB_H
|
||||
#define _ASM_IA64_MMIOWB_H
|
||||
|
||||
#include <asm/machvec.h>
|
||||
|
||||
/**
|
||||
* ___ia64_mmiowb - I/O write barrier
|
||||
*
|
||||
* Ensure ordering of I/O space writes. This will make sure that writes
|
||||
* following the barrier will arrive after all previous writes. For most
|
||||
* ia64 platforms, this is a simple 'mf.a' instruction.
|
||||
*/
|
||||
static inline void ___ia64_mmiowb(void)
|
||||
{
|
||||
ia64_mfa();
|
||||
}
|
||||
|
||||
#define __ia64_mmiowb ___ia64_mmiowb
|
||||
#define mmiowb() platform_mmiowb()
|
||||
|
||||
#include <asm-generic/mmiowb.h>
|
||||
|
||||
#endif /* _ASM_IA64_MMIOWB_H */
|
@@ -73,6 +73,8 @@ static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
|
||||
{
|
||||
unsigned short *p = (unsigned short *)&lock->lock + 1, tmp;
|
||||
|
||||
/* This could be optimised with ARCH_HAS_MMIOWB */
|
||||
mmiowb();
|
||||
asm volatile ("ld2.bias %0=[%1]" : "=r"(tmp) : "r"(p));
|
||||
WRITE_ONCE(*p, (tmp + 2) & ~1);
|
||||
}
|
||||
|
Reference in New Issue
Block a user