diff mbox

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

Message ID 1411530284-28807-1-git-send-email-behanw@converseincode.com
State Accepted
Commit 49dd0dcfd76091989a746968b7403e038a1953bf
Headers show

Commit Message

Behan Webster Sept. 24, 2014, 3:44 a.m. UTC
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.

Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Acked-by: Will Deacon <will.deacon@arm.com>
---
 arch/arm/mach-vt8500/vt8500.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Arnd Bergmann Sept. 24, 2014, 9:16 a.m. UTC | #1
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?

> Signed-off-by: Behan Webster <behanw@converseincode.com>
> Reviewed-by: Mark Charlebois <charlebm@gmail.com>
> Acked-by: Will Deacon <will.deacon@arm.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Behan Webster Sept. 24, 2014, 6:11 p.m. UTC | #2
On 09/24/14 02:16, Arnd Bergmann wrote:
> 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?
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.

>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>> Reviewed-by: Mark Charlebois <charlebm@gmail.com>
>> Acked-by: Will Deacon <will.deacon@arm.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> 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
Tony Prisk Sept. 24, 2014, 6:23 p.m. UTC | #3
On 24/09/14 21:16, Arnd Bergmann wrote:
> 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?
>
>> Signed-off-by: Behan Webster <behanw@converseincode.com>
>> Reviewed-by: Mark Charlebois <charlebm@gmail.com>
>> Acked-by: Will Deacon <will.deacon@arm.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> 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
Arnd Bergmann Sept. 25, 2014, 11:26 p.m. UTC | #4
On Wednesday 24 September 2014, Tony Prisk wrote:
> > 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

Patch

diff --git a/arch/arm/mach-vt8500/vt8500.c b/arch/arm/mach-vt8500/vt8500.c
index 2da7be3..3bc0dc9 100644
--- a/arch/arm/mach-vt8500/vt8500.c
+++ b/arch/arm/mach-vt8500/vt8500.c
@@ -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)