aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/include/asm/Kbuild1
-rw-r--r--arch/ia64/include/asm/io.h17
-rw-r--r--arch/ia64/include/asm/mmiowb.h25
-rw-r--r--arch/ia64/include/asm/spinlock.h2
4 files changed, 27 insertions, 18 deletions
diff --git a/arch/ia64/include/asm/Kbuild b/arch/ia64/include/asm/Kbuild
index cabfe0280c33..11f191689c9e 100644
--- a/arch/ia64/include/asm/Kbuild
+++ b/arch/ia64/include/asm/Kbuild
@@ -5,7 +5,6 @@ generic-y += irq_work.h
5generic-y += kvm_para.h 5generic-y += kvm_para.h
6generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
7generic-y += mm-arch-hooks.h 7generic-y += mm-arch-hooks.h
8generic-y += mmiowb.h
9generic-y += preempt.h 8generic-y += preempt.h
10generic-y += trace_clock.h 9generic-y += trace_clock.h
11generic-y += vtime.h 10generic-y += vtime.h
diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
index 1e6fef69bb01..a511d62d447a 100644
--- a/arch/ia64/include/asm/io.h
+++ b/arch/ia64/include/asm/io.h
@@ -113,20 +113,6 @@ extern int valid_mmap_phys_addr_range (unsigned long pfn, size_t count);
113 */ 113 */
114#define __ia64_mf_a() ia64_mfa() 114#define __ia64_mf_a() ia64_mfa()
115 115
116/**
117 * ___ia64_mmiowb - I/O write barrier
118 *
119 * Ensure ordering of I/O space writes. This will make sure that writes
120 * following the barrier will arrive after all previous writes. For most
121 * ia64 platforms, this is a simple 'mf.a' instruction.
122 *
123 * See Documentation/driver-api/device-io.rst for more information.
124 */
125static inline void ___ia64_mmiowb(void)
126{
127 ia64_mfa();
128}
129
130static inline void* 116static inline void*
131__ia64_mk_io_addr (unsigned long port) 117__ia64_mk_io_addr (unsigned long port)
132{ 118{
@@ -161,7 +147,6 @@ __ia64_mk_io_addr (unsigned long port)
161#define __ia64_writew ___ia64_writew 147#define __ia64_writew ___ia64_writew
162#define __ia64_writel ___ia64_writel 148#define __ia64_writel ___ia64_writel
163#define __ia64_writeq ___ia64_writeq 149#define __ia64_writeq ___ia64_writeq
164#define __ia64_mmiowb ___ia64_mmiowb
165 150
166/* 151/*
167 * For the in/out routines, we need to do "mf.a" _after_ doing the I/O access to ensure 152 * 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)
296#define __outb platform_outb 281#define __outb platform_outb
297#define __outw platform_outw 282#define __outw platform_outw
298#define __outl platform_outl 283#define __outl platform_outl
299#define __mmiowb platform_mmiowb
300 284
301#define inb(p) __inb(p) 285#define inb(p) __inb(p)
302#define inw(p) __inw(p) 286#define inw(p) __inw(p)
@@ -310,7 +294,6 @@ __outsl (unsigned long port, const void *src, unsigned long count)
310#define outsb(p,s,c) __outsb(p,s,c) 294#define outsb(p,s,c) __outsb(p,s,c)
311#define outsw(p,s,c) __outsw(p,s,c) 295#define outsw(p,s,c) __outsw(p,s,c)
312#define outsl(p,s,c) __outsl(p,s,c) 296#define outsl(p,s,c) __outsl(p,s,c)
313#define mmiowb() __mmiowb()
314 297
315/* 298/*
316 * The address passed to these functions are ioremap()ped already. 299 * The address passed to these functions are ioremap()ped already.
diff --git a/arch/ia64/include/asm/mmiowb.h b/arch/ia64/include/asm/mmiowb.h
new file mode 100644
index 000000000000..297b85ac84a0
--- /dev/null
+++ b/arch/ia64/include/asm/mmiowb.h
@@ -0,0 +1,25 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _ASM_IA64_MMIOWB_H
4#define _ASM_IA64_MMIOWB_H
5
6#include <asm/machvec.h>
7
8/**
9 * ___ia64_mmiowb - I/O write barrier
10 *
11 * Ensure ordering of I/O space writes. This will make sure that writes
12 * following the barrier will arrive after all previous writes. For most
13 * ia64 platforms, this is a simple 'mf.a' instruction.
14 */
15static inline void ___ia64_mmiowb(void)
16{
17 ia64_mfa();
18}
19
20#define __ia64_mmiowb ___ia64_mmiowb
21#define mmiowb() platform_mmiowb()
22
23#include <asm-generic/mmiowb.h>
24
25#endif /* _ASM_IA64_MMIOWB_H */
diff --git a/arch/ia64/include/asm/spinlock.h b/arch/ia64/include/asm/spinlock.h
index afd0b3121b4c..5f620e66384e 100644
--- a/arch/ia64/include/asm/spinlock.h
+++ b/arch/ia64/include/asm/spinlock.h
@@ -73,6 +73,8 @@ static __always_inline void __ticket_spin_unlock(arch_spinlock_t *lock)
73{ 73{
74 unsigned short *p = (unsigned short *)&lock->lock + 1, tmp; 74 unsigned short *p = (unsigned short *)&lock->lock + 1, tmp;
75 75
76 /* This could be optimised with ARCH_HAS_MMIOWB */
77 mmiowb();
76 asm volatile ("ld2.bias %0=[%1]" : "=r"(tmp) : "r"(p)); 78 asm volatile ("ld2.bias %0=[%1]" : "=r"(tmp) : "r"(p));
77 WRITE_ONCE(*p, (tmp + 2) & ~1); 79 WRITE_ONCE(*p, (tmp + 2) & ~1);
78} 80}