Skip to contentSkip to conversation

arm, vt8500, LLVMLlinux: Use mcr instead of mcr% for mach-vt8500

PATCH Applied Behan Webster 3 participants 5 messages Sep 24, 2014 – Sep 25, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm, vt8500, LLVMLlinux: Use mcr instead of mcr% for mach-vt8500

The ASM below does not compile with clang and is not the way that the mcr command is used in other parts of the kernel.

arch/arm/mach-vt8500/vt8500.c:72:11: error: invalid % escape in inline assembly string

        asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

There are other forms that are supported on different ARM instruction sets but generally the kernel just uses mcr as it is supported in all ARM instruction sets.

---
 arch/arm/mach-vt8500/vt8500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-vt8500/vt8500.c +1 -1
index 2da7be3..3bc0dc9 100644
@@ -69,7 +69,7 @@ static void vt8500_power_off(void)
 {
 	local_irq_disable();
 	writew(5, pmc_base + VT8500_HCR_REG);
-	asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
+	asm("mcr p15, 0, %0, c7, c0, 4" : : "r" (0));
 }
 
 static void __init vt8500_init(void)
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Tuesday 23 September 2014 20:44:44 Behan Webster wrote:

The ASM below does not compile with clang and is not the way that the mcr command is used in other parts of the kernel.

arch/arm/mach-vt8500/vt8500.c:72:11: error: invalid % escape in inline assembly string

        asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
            ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

There are other forms that are supported on different ARM instruction sets but generally the kernel just uses mcr as it is supported in all ARM instruction sets.

Just for confirm: both forms are actually correct and we don't need this backported for stable, right?

Quoted 3 lines

Tony, would you like to pick this one up and send it in a pull request to arm-soc, or should we apply it to fixes-non-critical directly?

Arnd

#2 lore raw
Quoted 9 lines · Arnd Bergmann
Quoted 8 lines · On Tuesday 23 September 2014 20:44:44 Behan Webster wrote:

The ASM below does not compile with clang and is not the way that the mcr command is used in other parts of the kernel.

arch/arm/mach-vt8500/vt8500.c:72:11: error: invalid % escape in inline assembly string

         asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

Quoted 5 lines
Quoted 3 lines

There are other forms that are supported on different ARM instruction sets but generally the kernel just uses mcr as it is supported in all ARM instruction sets.

Just for confirm: both forms are actually correct and we don't need this backported for stable, right?

My understanding is that the %? carries a condition code to the next instruction (which in this case is then ignored). So essentially in this situation both are equivalent.

Quoted 7 lines
Quoted 3 lines

Tony, would you like to pick this one up and send it in a pull request to arm-soc, or should we apply it to fixes-non-critical directly?

Thanks,

Behan

Signature · 2 lines
Behan Webster
behanw at converseincode.com
#3 lore raw
In reply to Arnd Bergmann
Quoted 18 lines · Arnd Bergmann
Quoted 11 lines · On Tuesday 23 September 2014 20:44:44 Behan Webster wrote:

The ASM below does not compile with clang and is not the way that the mcr command is used in other parts of the kernel.

arch/arm/mach-vt8500/vt8500.c:72:11: error: invalid % escape in inline assembly string

         asm("mcr%? p15, 0, %0, c7, c0, 4" : : "r" (0));
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~

1 error generated.

There are other forms that are supported on different ARM instruction sets but generally the kernel just uses mcr as it is supported in all ARM instruction sets.

Just for confirm: both forms are actually correct and we don't need this backported for stable, right?

Quoted 3 lines
Quoted 6 lines

Tony, would you like to pick this one up and send it in a pull request to arm-soc, or should we apply it to fixes-non-critical directly?

Arnd

Arnd,

You can apply it directly to fixes-non-critical if that's ok.

Regards
Tony Prisk

#4 lore raw
Quoted 7 lines · Tony Prisk
Quoted 4 lines

Tony, would you like to pick this one up and send it in a pull request to arm-soc, or should we apply it to fixes-non-critical directly?

Arnd

Arnd,

You can apply it directly to fixes-non-critical if that's ok.

Applied, thanks!

Arnd