diff options
author | Andrea Adami <andrea.adami@gmail.com> | 2013-09-26 18:23:02 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-03 05:39:43 -0400 |
commit | 856337283a215b9f92189f22862e4415f4d6bd85 (patch) | |
tree | 5e4df1fd0de4d56a07b6a66014ca81caca190664 /arch/arm/common | |
parent | 262576fffe425ee7768f2686ad5536907d828764 (diff) |
ARM: 7845/1: sharpsl_param.c: fix invalid memory access for pxa devices
This fixes a regression for kernels after v3.2
After commit 72662e01088394577be4a3f14da94cf87bea2591
ARM: head.S: only include __turn_mmu_on in the initial identity mapping
Zaurus PXA devices call sharpsl_save_param() during fixup and hang on
boot because memcpy refers to physical addresses no longer valid if the
MMU is setup.
Zaurus collie (SA1100) is unaffected (function is called in init_machine).
The code was making assumptions and for PXA the virtual address
should have been used before.
Signed-off-by: Marko Katic <dromede@gmail.com>
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/sharpsl_param.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index d56c932580eb..025f6ce38596 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include <asm/mach/sharpsl_param.h> | 17 | #include <asm/mach/sharpsl_param.h> |
18 | #include <asm/memory.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * Certain hardware parameters determined at the time of device manufacture, | 21 | * Certain hardware parameters determined at the time of device manufacture, |
@@ -25,8 +26,10 @@ | |||
25 | */ | 26 | */ |
26 | #ifdef CONFIG_ARCH_SA1100 | 27 | #ifdef CONFIG_ARCH_SA1100 |
27 | #define PARAM_BASE 0xe8ffc000 | 28 | #define PARAM_BASE 0xe8ffc000 |
29 | #define param_start(x) (void *)(x) | ||
28 | #else | 30 | #else |
29 | #define PARAM_BASE 0xa0000a00 | 31 | #define PARAM_BASE 0xa0000a00 |
32 | #define param_start(x) __va(x) | ||
30 | #endif | 33 | #endif |
31 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) | 34 | #define MAGIC_CHG(a,b,c,d) ( ( d << 24 ) | ( c << 16 ) | ( b << 8 ) | a ) |
32 | 35 | ||
@@ -41,7 +44,7 @@ EXPORT_SYMBOL(sharpsl_param); | |||
41 | 44 | ||
42 | void sharpsl_save_param(void) | 45 | void sharpsl_save_param(void) |
43 | { | 46 | { |
44 | memcpy(&sharpsl_param, (void *)PARAM_BASE, sizeof(struct sharpsl_param_info)); | 47 | memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); |
45 | 48 | ||
46 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) | 49 | if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) |
47 | sharpsl_param.comadj=-1; | 50 | sharpsl_param.comadj=-1; |