kernel-hacking-2024-linux-s.../arch/powerpc
Paul Mackerras f007cacffc [POWERPC] Fix MMIO ops to provide expected barrier behaviour
This changes the writeX family of functions to have a sync instruction
before the MMIO store rather than after, because the generally expected
behaviour is that the device receiving the MMIO store can be guaranteed
to see the effects of any preceding writes to normal memory.

To preserve ordering between writeX and readX, and to preserve ordering
between preceding stores and the readX, the readX family of functions
have had an sync added before the load.

Although writeX followed by spin_unlock is not officially guaranteed
to keep the writeX inside the spin-locked region unless an mmiowb()
is used, there are currently drivers that depend on the previous
behaviour on powerpc, which was that the mmiowb wasn't actually required.
Therefore we have a per-cpu flag that is set by writeX, cleared by
__raw_spin_lock and mmiowb, and tested by __raw_spin_unlock.  If it is
set, __raw_spin_unlock does a sync and clears it.

This changes both 32-bit and 64-bit readX/writeX.  32-bit already has a
sync in __raw_spin_unlock (since lwsync doesn't exist on 32-bit), and thus
doesn't need the per-cpu flag.

Tested on G5 (PPC970) and POWER5.

Signed-off-by: Paul Mackerras <paulus@samba.org>
2006-09-13 22:08:26 +10:00
..
boot [POWERPC] Add mpc7448hpc2 device tree source file 2006-08-30 10:36:13 +10:00
configs [POWERPC] Update defconfigs 2006-09-10 11:04:36 +10:00
kernel [POWERPC] Fix MMIO ops to provide expected barrier behaviour 2006-09-13 22:08:26 +10:00
lib [POWERPC] Fix return value from memcpy 2006-08-31 13:22:58 +10:00
math-emu Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
mm [POWERPC] Fix powerpc 44x_mmu build 2006-08-25 13:41:41 +10:00
oprofile [PATCH] oprofile: Fix unnecessary cleverness 2006-06-26 09:58:17 -07:00
platforms [POWERPC] Add new, missing argument to of_irq_map_raw() for 86xx. 2006-09-13 18:28:28 +10:00
sysdev [POWERPC] Support for "weird" MPICs and fixup mpc7448_hpc2 2006-08-30 14:29:42 +10:00
xmon Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
Kconfig [POWERPC] Support for "weird" MPICs and fixup mpc7448_hpc2 2006-08-30 14:29:42 +10:00
Kconfig.debug [POWERPC] Add udbg support for RTAS console 2006-06-28 11:59:48 +10:00
Makefile [POWERPC] Remove stale 64bit on 32bit kernel code 2006-06-15 19:31:26 +10:00