summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPunit Agrawal <punit.agrawal@arm.com>2014-09-01 17:16:01 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-09-12 17:38:58 +0100
commite918a62a2ba81d10a3cc2c513dc70034c9524a95 (patch)
tree6f2c9f379f791a251319be69149d0061b5672aeb /arch
parenta040803a9d6b8c1876d3487a5cb69602ebcbb82c (diff)
downloadlinux-e918a62a2ba81d10a3cc2c513dc70034c9524a95.tar.gz
linux-e918a62a2ba81d10a3cc2c513dc70034c9524a95.tar.bz2
linux-e918a62a2ba81d10a3cc2c513dc70034c9524a95.zip
ARM: 8135/1: Fix in-correct barrier usage in SWP{B} emulation
According to the ARM ARMv7, explicit barriers are necessary when using synchronisation primitives such as SWP{B}. The use of these instructions does not automatically imply a barrier and any ordering requirements by the software must be explicitly expressed with the use of suitable barriers. Based on this, remove the barriers from SWP{B} emulation. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Punit Agrawal <punit.agrawal@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/kernel/swp_emulate.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
index 67ca8578c6d8..587fdfe1a72c 100644
--- a/arch/arm/kernel/swp_emulate.c
+++ b/arch/arm/kernel/swp_emulate.c
@@ -142,14 +142,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data,
while (1) {
unsigned long temp;
- /*
- * Barrier required between accessing protected resource and
- * releasing a lock for it. Legacy code might not have done
- * this, and we cannot determine that this is not the case
- * being emulated, so insert always.
- */
- smp_mb();
-
if (type == TYPE_SWPB)
__user_swpb_asm(*data, address, res, temp);
else
@@ -162,13 +154,6 @@ static int emulate_swpX(unsigned int address, unsigned int *data,
}
if (res == 0) {
- /*
- * Barrier also required between acquiring a lock for a
- * protected resource and accessing the resource. Inserted for
- * same reason as above.
- */
- smp_mb();
-
if (type == TYPE_SWPB)
swpbcounter++;
else