diff mbox

[2/2] irqchip/gic-v3: Use nops macro for Cavium ThunderX erratum 23154

Message ID 1477653838-21569-2-git-send-email-will.deacon@arm.com
State New
Headers show

Commit Message

Will Deacon Oct. 28, 2016, 11:23 a.m. UTC
The workaround for Cavium ThunderX erratum 23154 has a homebrew
pipeflush built out of NOP sequences around the read of the IAR.

This patch converts the code to use the new nops macro, which makes it
a little easier to read.

Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

---
 arch/arm64/include/asm/arch_gicv3.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

-- 
2.1.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Comments

Mark Rutland Oct. 28, 2016, 3:10 p.m. UTC | #1
On Fri, Oct 28, 2016 at 12:23:58PM +0100, Will Deacon wrote:
> The workaround for Cavium ThunderX erratum 23154 has a homebrew

> pipeflush built out of NOP sequences around the read of the IAR.

> 

> This patch converts the code to use the new nops macro, which makes it

> a little easier to read.

> 

> Cc: Marc Zyngier <marc.zyngier@arm.com>

> Signed-off-by: Will Deacon <will.deacon@arm.com>


Reviewed-by: Mark Rutland <mark.rutland@arm.com>


(yes, I counted them)

Thanks,
Mark.

> ---

>  arch/arm64/include/asm/arch_gicv3.h | 9 ++-------

>  1 file changed, 2 insertions(+), 7 deletions(-)

> 

> diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h

> index fdf34f8b4ee0..0313670a3e3f 100644

> --- a/arch/arm64/include/asm/arch_gicv3.h

> +++ b/arch/arm64/include/asm/arch_gicv3.h

> @@ -122,14 +122,9 @@ static inline u64 gic_read_iar_cavium_thunderx(void)

>  {

>  	u64 irqstat;

>  

> -	asm volatile(

> -		"nop;nop;nop;nop\n\t"

> -		"nop;nop;nop;nop");

> -

> +	nops(8);

>  	irqstat = read_sysreg_s(ICC_IAR1_EL1);

> -

> -	asm volatile(

> -		"nop;nop;nop;nop");

> +	nops(4);

>  	mb();

>  

>  	return irqstat;

> -- 

> 2.1.4

> 

> 

> _______________________________________________

> linux-arm-kernel mailing list

> linux-arm-kernel@lists.infradead.org

> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Marc Zyngier Oct. 28, 2016, 3:16 p.m. UTC | #2
Hi Will,

On 28/10/16 12:23, Will Deacon wrote:
> The workaround for Cavium ThunderX erratum 23154 has a homebrew

> pipeflush built out of NOP sequences around the read of the IAR.

> 

> This patch converts the code to use the new nops macro, which makes it

> a little easier to read.

> 

> Cc: Marc Zyngier <marc.zyngier@arm.com>

> Signed-off-by: Will Deacon <will.deacon@arm.com>


Both patches queued for 4.10.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h
index fdf34f8b4ee0..0313670a3e3f 100644
--- a/arch/arm64/include/asm/arch_gicv3.h
+++ b/arch/arm64/include/asm/arch_gicv3.h
@@ -122,14 +122,9 @@  static inline u64 gic_read_iar_cavium_thunderx(void)
 {
 	u64 irqstat;
 
-	asm volatile(
-		"nop;nop;nop;nop\n\t"
-		"nop;nop;nop;nop");
-
+	nops(8);
 	irqstat = read_sysreg_s(ICC_IAR1_EL1);
-
-	asm volatile(
-		"nop;nop;nop;nop");
+	nops(4);
 	mb();
 
 	return irqstat;