Skip to content

Commit

Permalink
ARM: 6784/1: errata: no automatic Store Buffer drain on Cortex-A9
Browse files Browse the repository at this point in the history
On revisions of the Cortex-A9 prior to r2p0, the Store Buffer does not
have any automatic draining mechanism and therefore a livelock may occur
if an external agent continuously polls a memory location waiting to
observe an update.

This workaround defines cpu_relax() as smp_mb(), preventing correctly
written polling loops from denying visibility of updates to memory.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Will Deacon authored and Russell King committed Mar 9, 2011
1 parent fcbdc5f commit 5dab26a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,17 @@ config ARM_ERRATA_754322
the new ASID. This workaround places two dsb instructions in the mm
switching code so that no page table walks can cross the ASID switch.

config ARM_ERRATA_754327
bool "ARM errata: no automatic Store Buffer drain"
depends on CPU_V7 && SMP
help
This option enables the workaround for the 754327 Cortex-A9 (prior to
r2p0) erratum. The Store Buffer does not have any automatic draining
mechanism and therefore a livelock may occur if an external agent
continuously polls a memory location waiting to observe an update.
This workaround defines cpu_relax() as smp_mb(), preventing correctly
written polling loops from denying visibility of updates to memory.

endmenu

source "arch/arm/common/Kconfig"
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ extern void release_thread(struct task_struct *);

unsigned long get_wchan(struct task_struct *p);

#if __LINUX_ARM_ARCH__ == 6
#if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
#define cpu_relax() smp_mb()
#else
#define cpu_relax() barrier()
Expand Down

0 comments on commit 5dab26a

Please sign in to comment.