Commit:     2d3fbbb391e280724f7f7804ab00ff61cf1b6a4c
Parent:     e1fa2e136ff64a3814a98c03d46320b9e80d29c8
Author:     Benjamin Herrenschmidt <[EMAIL PROTECTED]>
AuthorDate: Thu May 10 22:22:46 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri May 11 08:29:34 2007 -0700

    Add hard_irq_disable()
    Some architectures, like powerpc, implement lazy disabling of interrupts.
    That means that on those, local_irq_disable() doesn't actually disable
    interrupts on the CPU, but only sets some per CPU flag which cause them to 
    disabled only if an interrupt actually occurs.
    However, in some cases, such as stop_machine, we really want interrupts to 
    fully disabled.  For example, I have code using stop machine to do ECC error
    injection, used to verify operations of the ECC hardware, that sort of 
    It really needs to make sure that nothing is actually writing to memory 
    the injection happens.  Similar examples can be found in other low level 
    and pieces.
    This patch implements a generic hard_irq_disable() function which is meant 
    be called -after- local_irq_disable() and ensures that interrupts are fully
    disabled on that CPU.  The default implementation is a nop, though powerpc
    does already provide an appropriate one.
    Signed-off-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
    Cc: Rusty Russell <[EMAIL PROTECTED]>
    Cc: Paul Mackerras <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 include/linux/interrupt.h |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index f7b01b9..5323f62 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -241,6 +241,16 @@ static inline void __deprecated save_and_cli(unsigned long 
 #define save_and_cli(x)        save_and_cli(&x)
 #endif /* CONFIG_SMP */
+/* Some architectures might implement lazy enabling/disabling of
+ * interrupts. In some cases, such as stop_machine, we might want
+ * to ensure that after a local_irq_disable(), interrupts have
+ * really been disabled in hardware. Such architectures need to
+ * implement the following hook.
+ */
+#ifndef hard_irq_disable
+#define hard_irq_disable()     do { } while(0)
 /* PLEASE, avoid to allocate new softirqs, if you need not _really_ high
    frequency threaded job scheduling. For almost all the purposes
    tasklets are more than enough. F.e. all serial device BHs et
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to