linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make hard_irq_disable() actually hard-disable interrupts
@ 2012-06-14 10:31 Paul Mackerras
  2012-06-14 11:34 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Mackerras @ 2012-06-14 10:31 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, linuxppc-dev

At present, hard_irq_disable() does nothing because of this code in
include/linux/interrupt.h:

#ifndef hard_irq_disable
#define hard_irq_disable()	do { } while(0)
#endif

So we need to make our hard_irq_disable() be a macro.

Signed-off-by: Paul Mackerras <paulus@samba.org>

---
 arch/powerpc/include/asm/hw_irq.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
index c9aac24..d8f873f 100644
--- a/arch/powerpc/include/asm/hw_irq.h
+++ b/arch/powerpc/include/asm/hw_irq.h
@@ -93,12 +93,13 @@ static inline bool arch_irqs_disabled(void)
 #define __hard_irq_disable()	__mtmsrd(local_paca->kernel_msr, 1)
 #endif
 
-static inline void hard_irq_disable(void)
+static inline void _hard_irq_disable(void)
 {
 	__hard_irq_disable();
 	get_paca()->soft_enabled = 0;
 	get_paca()->irq_happened |= PACA_IRQ_HARD_DIS;
 }
+#define hard_irq_disable()	_hard_irq_disable()
 
 /*
  * This is called by asynchronous interrupts to conditionally

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make hard_irq_disable() actually hard-disable interrupts
  2012-06-14 10:31 [PATCH] Make hard_irq_disable() actually hard-disable interrupts Paul Mackerras
@ 2012-06-14 11:34 ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2012-06-14 11:34 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

On Thu, 2012-06-14 at 20:31 +1000, Paul Mackerras wrote:
> At present, hard_irq_disable() does nothing because of this code in
> include/linux/interrupt.h:
> 
> #ifndef hard_irq_disable
> #define hard_irq_disable()	do { } while(0)
> #endif
> 
> So we need to make our hard_irq_disable() be a macro.
> 
> Signed-off-by: Paul Mackerras <paulus@samba.org>

This was broken by my rewrite of the lazy irq stuff when I turned that
from a macro to a function. So it should be CC'ed to stable 3.4.

Also I think it's simpler (and we do that commonly) to just do

#define hard_irq_disable hard_irq_disable

Cheers,
Ben.

> ---
>  arch/powerpc/include/asm/hw_irq.h |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> diff --git a/arch/powerpc/include/asm/hw_irq.h b/arch/powerpc/include/asm/hw_irq.h
> index c9aac24..d8f873f 100644
> --- a/arch/powerpc/include/asm/hw_irq.h
> +++ b/arch/powerpc/include/asm/hw_irq.h
> @@ -93,12 +93,13 @@ static inline bool arch_irqs_disabled(void)
>  #define __hard_irq_disable()	__mtmsrd(local_paca->kernel_msr, 1)
>  #endif
>  
> -static inline void hard_irq_disable(void)
> +static inline void _hard_irq_disable(void)
>  {
>  	__hard_irq_disable();
>  	get_paca()->soft_enabled = 0;
>  	get_paca()->irq_happened |= PACA_IRQ_HARD_DIS;
>  }
> +#define hard_irq_disable()	_hard_irq_disable()
>  
>  /*
>   * This is called by asynchronous interrupts to conditionally

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-14 11:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-14 10:31 [PATCH] Make hard_irq_disable() actually hard-disable interrupts Paul Mackerras
2012-06-14 11:34 ` Benjamin Herrenschmidt

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).