[PATCH 1/3] powerpc: Add __hard_irqs_disabled()

Balbir Singh bsingharora at gmail.com
Wed May 17 21:04:47 AEST 2017


On Tue, 2017-05-16 at 14:56 +0530, Aneesh Kumar K.V wrote:
> Add __hard_irqs_disabled() similar to arch_irqs_disabled to check whether irqs
> are hard disabled.
> 
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
> ---
>  arch/powerpc/include/asm/hw_irq.h | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
> index eba60416536e..541bd42f902f 100644
> --- a/arch/powerpc/include/asm/hw_irq.h
> +++ b/arch/powerpc/include/asm/hw_irq.h
> @@ -88,6 +88,12 @@ static inline bool arch_irqs_disabled(void)
>  	return arch_irqs_disabled_flags(arch_local_save_flags());
>  }
>  
> +static inline bool __hard_irqs_disabled(void)
> +{
> +	unsigned long flags = mfmsr();
> +	return (flags & MSR_EE) == 0;

I have some patches that ensure MSR_EE is never 0, what are we protecting
against - external interrupts, IPI's or something else? I suspect its IPI's

Balbir SIngh.



More information about the Linuxppc-dev mailing list