diff options
| -rw-r--r-- | arch/sh/include/asm/Kbuild | 1 | ||||
| -rw-r--r-- | arch/sh/include/asm/io.h | 3 | ||||
| -rw-r--r-- | arch/sh/include/asm/mmiowb.h | 12 | ||||
| -rw-r--r-- | arch/sh/include/asm/spinlock-llsc.h | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/arch/sh/include/asm/Kbuild b/arch/sh/include/asm/Kbuild index 162c9054561f..7bf2cb680d32 100644 --- a/arch/sh/include/asm/Kbuild +++ b/arch/sh/include/asm/Kbuild | |||
| @@ -14,7 +14,6 @@ generic-y += local.h | |||
| 14 | generic-y += local64.h | 14 | generic-y += local64.h |
| 15 | generic-y += mcs_spinlock.h | 15 | generic-y += mcs_spinlock.h |
| 16 | generic-y += mm-arch-hooks.h | 16 | generic-y += mm-arch-hooks.h |
| 17 | generic-y += mmiowb.h | ||
| 18 | generic-y += parport.h | 17 | generic-y += parport.h |
| 19 | generic-y += percpu.h | 18 | generic-y += percpu.h |
| 20 | generic-y += preempt.h | 19 | generic-y += preempt.h |
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 4f7f235f15f8..c28e37a344ad 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h | |||
| @@ -229,9 +229,6 @@ __BUILD_IOPORT_STRING(q, u64) | |||
| 229 | 229 | ||
| 230 | #define IO_SPACE_LIMIT 0xffffffff | 230 | #define IO_SPACE_LIMIT 0xffffffff |
| 231 | 231 | ||
| 232 | /* synco on SH-4A, otherwise a nop */ | ||
| 233 | #define mmiowb() wmb() | ||
| 234 | |||
| 235 | /* We really want to try and get these to memcpy etc */ | 232 | /* We really want to try and get these to memcpy etc */ |
| 236 | void memcpy_fromio(void *, const volatile void __iomem *, unsigned long); | 233 | void memcpy_fromio(void *, const volatile void __iomem *, unsigned long); |
| 237 | void memcpy_toio(volatile void __iomem *, const void *, unsigned long); | 234 | void memcpy_toio(volatile void __iomem *, const void *, unsigned long); |
diff --git a/arch/sh/include/asm/mmiowb.h b/arch/sh/include/asm/mmiowb.h new file mode 100644 index 000000000000..535d59735f1d --- /dev/null +++ b/arch/sh/include/asm/mmiowb.h | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | /* SPDX-License-Identifier: GPL-2.0 */ | ||
| 2 | #ifndef __ASM_SH_MMIOWB_H | ||
| 3 | #define __ASM_SH_MMIOWB_H | ||
| 4 | |||
| 5 | #include <asm/barrier.h> | ||
| 6 | |||
| 7 | /* synco on SH-4A, otherwise a nop */ | ||
| 8 | #define mmiowb() wmb() | ||
| 9 | |||
| 10 | #include <asm-generic/mmiowb.h> | ||
| 11 | |||
| 12 | #endif /* __ASM_SH_MMIOWB_H */ | ||
diff --git a/arch/sh/include/asm/spinlock-llsc.h b/arch/sh/include/asm/spinlock-llsc.h index 786ee0fde3b0..7fd929cd2e7a 100644 --- a/arch/sh/include/asm/spinlock-llsc.h +++ b/arch/sh/include/asm/spinlock-llsc.h | |||
| @@ -47,6 +47,8 @@ static inline void arch_spin_unlock(arch_spinlock_t *lock) | |||
| 47 | { | 47 | { |
| 48 | unsigned long tmp; | 48 | unsigned long tmp; |
| 49 | 49 | ||
| 50 | /* This could be optimised with ARCH_HAS_MMIOWB */ | ||
| 51 | mmiowb(); | ||
| 50 | __asm__ __volatile__ ( | 52 | __asm__ __volatile__ ( |
| 51 | "mov #1, %0 ! arch_spin_unlock \n\t" | 53 | "mov #1, %0 ! arch_spin_unlock \n\t" |
| 52 | "mov.l %0, @%1 \n\t" | 54 | "mov.l %0, @%1 \n\t" |
