Patchwork [3/3] MIPS: BCM63XX: disable unaligned accesses for SMP

login
register
mail settings
Submitter Jonas Gorski
Date July 21, 2014, 8:47 p.m.
Message ID <1405975648-25375-4-git-send-email-jogo@openwrt.org>
Download mbox | patch
Permalink /patch/372201/
State New
Headers show

Comments

Jonas Gorski - July 21, 2014, 8:47 p.m.
Unaligned accesses to flash can cause random wrong reads when having
both cores enabled. This is easily noticable with a jffs2 filesystem,
as jffs2 reads its filenames into an unaligned bytebuffer.
This can cause random boot failures when critical files have their read
filenames corrupted.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
---
 arch/mips/bcm63xx/dev-flash.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/arch/mips/bcm63xx/dev-flash.c b/arch/mips/bcm63xx/dev-flash.c
index 172dd83..f6a7116 100644
--- a/arch/mips/bcm63xx/dev-flash.c
+++ b/arch/mips/bcm63xx/dev-flash.c
@@ -36,6 +36,7 @@  static struct physmap_flash_data flash_data = {
 	.width			= 2,
 	.parts			= mtd_partitions,
 	.part_probe_types	= bcm63xx_part_types,
+	.no_unaligned_access	= IS_ENABLED(CONFIG_SMP),
 };
 
 static struct resource mtd_resources[] = {