1
0
Fork 0
alistair23-linux/arch/alpha
Mikulas Patocka c81e34c434 alpha: fix memory barriers so that they conform to the specification
commit 54505a1e20 upstream.

The commits cd0e00c106 and 92d7223a74 broke boot on the Alpha Avanti
platform. The patches move memory barriers after a write before the write.
The result is that if there's iowrite followed by ioread, there is no
barrier between them.

The Alpha architecture allows reordering of the accesses to the I/O space,
and the missing barrier between write and read causes hang with serial
port and real time clock.

This patch makes barriers confiorm to the specification.

1. We add mb() before readX_relaxed and writeX_relaxed -
   memory-barriers.txt claims that these functions must be ordered w.r.t.
   each other. Alpha doesn't order them, so we need an explicit barrier.
2. We add mb() before reads from the I/O space - so that if there's a
   write followed by a read, there should be a barrier between them.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Fixes: cd0e00c106 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering")
Fixes: 92d7223a74 ("alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2")
Cc: stable@vger.kernel.org      # v4.17+
Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reviewed-by: Maciej W. Rozycki <macro@linux-mips.org>
Signed-off-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-22 09:31:21 +02:00
..
boot treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
configs alpha: move arch/alpha/defconfig to arch/alpha/configs/defconfig 2019-05-18 11:49:55 +09:00
include alpha: fix memory barriers so that they conform to the specification 2020-06-22 09:31:21 +02:00
kernel alpha: fix memory barriers so that they conform to the specification 2020-06-22 09:31:21 +02:00
lib Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
math-emu treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mm Merge branch 'siginfo-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2019-07-08 21:48:15 -07:00
oprofile smp: Remove smp_call_function() and on_each_cpu() return values 2019-06-23 14:26:26 +02:00
Kconfig kbuild: add CONFIG_ASM_MODVERSIONS 2019-08-22 01:14:11 +09:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Makefile kconfig: make arch/*/configs/defconfig the default of KBUILD_DEFCONFIG 2019-06-09 15:08:18 +09:00