* [PATCH] ARM: fix isb regression on CPU < v7
@ 2010-10-05 19:53 Linus Walleij
2010-10-06 8:29 ` Will Deacon
0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2010-10-05 19:53 UTC (permalink / raw)
To: linux-arm-kernel
The kernel does not compile for my ARM926EJ-S system U300 due to
the isb instruction inserted in generic assember statement from
commit 8925ec4c530094b878e7e28a1fd78e7122afd973, "ARM: 6385/1:
setup: detect aliasing I-cache when D-cache is non-aliasing"
hey the isb is only available when assembling for v7 so let's
use the generic isb() macro from setup.h instead.
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
---
arch/arm/kernel/setup.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 4572cf8..336f14e 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -247,11 +247,12 @@ static int cpu_has_aliasing_icache(unsigned int arch)
/* arch specifies the register format */
switch (arch) {
case CPU_ARCH_ARMv7:
- asm("mcr p15, 2, %1, c0, c0, 0 @ set CSSELR\n"
- "isb\n"
- "mrc p15, 1, %0, c0, c0, 0 @ read CCSIDR"
- : "=r" (id_reg)
+ asm("mcr p15, 2, %0, c0, c0, 0 @ set CSSELR"
+ : /* No output operands */
: "r" (1));
+ isb();
+ asm("mrc p15, 1, %0, c0, c0, 0 @ read CCSIDR"
+ : "=r" (id_reg));
line_size = 4 << ((id_reg & 0x7) + 2);
num_sets = ((id_reg >> 13) & 0x7fff) + 1;
aliasing_icache = (line_size * num_sets) > PAGE_SIZE;
--
1.7.2.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH] ARM: fix isb regression on CPU < v7
2010-10-05 19:53 [PATCH] ARM: fix isb regression on CPU < v7 Linus Walleij
@ 2010-10-06 8:29 ` Will Deacon
0 siblings, 0 replies; 2+ messages in thread
From: Will Deacon @ 2010-10-06 8:29 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
> The kernel does not compile for my ARM926EJ-S system U300 due to
> the isb instruction inserted in generic assember statement from
> commit 8925ec4c530094b878e7e28a1fd78e7122afd973, "ARM: 6385/1:
> setup: detect aliasing I-cache when D-cache is non-aliasing"
> hey the isb is only available when assembling for v7 so let's
> use the generic isb() macro from setup.h instead.
>
> Cc: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
Oops, well spotted! I suppose it's asking a bit much of the compiler
for it to optimise that case statement away when you're not building
for a v7 target :)
Acked-by: Will Deacon <will.deacon@arm.com>
Cheers,
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-06 8:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-05 19:53 [PATCH] ARM: fix isb regression on CPU < v7 Linus Walleij
2010-10-06 8:29 ` Will Deacon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).