libata-sff: ata_sff_[dumb_]qc_prep are BMDMA specific
[safe/jmp/linux-2.6] / include / linux / irq.h
index eedbb8e..707ab12 100644 (file)
@@ -69,6 +69,8 @@ typedef       void (*irq_flow_handler_t)(unsigned int irq,
 #define IRQ_MOVE_PCNTXT                0x01000000      /* IRQ migration from process context */
 #define IRQ_AFFINITY_SET       0x02000000      /* IRQ affinity was set from userspace*/
 #define IRQ_SUSPENDED          0x04000000      /* IRQ has gone through suspend sequence */
+#define IRQ_ONESHOT            0x08000000      /* IRQ is not unmasked after hardirq */
+#define IRQ_NESTED_THREAD      0x10000000      /* IRQ is nested into another, no own handler thread */
 
 #ifdef CONFIG_IRQ_PER_CPU
 # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU)
@@ -88,7 +90,7 @@ struct msi_desc;
  * @startup:           start up the interrupt (defaults to ->enable if NULL)
  * @shutdown:          shut down the interrupt (defaults to ->disable if NULL)
  * @enable:            enable the interrupt (defaults to chip->unmask if NULL)
- * @disable:           disable the interrupt (defaults to chip->mask if NULL)
+ * @disable:           disable the interrupt
  * @ack:               start of a new interrupt
  * @mask:              mask an interrupt source
  * @mask_ack:          ack and mask an interrupt source
@@ -100,6 +102,9 @@ struct msi_desc;
  * @set_type:          set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ
  * @set_wake:          enable/disable power-management wake-on of an IRQ
  *
+ * @bus_lock:          function to lock access to slow bus (i2c) chips
+ * @bus_sync_unlock:   function to sync and unlock slow bus (i2c) chips
+ *
  * @release:           release function solely used by UML
  * @typename:          obsoleted by name, kept as migration helper
  */
@@ -123,6 +128,9 @@ struct irq_chip {
        int             (*set_type)(unsigned int irq, unsigned int flow_type);
        int             (*set_wake)(unsigned int irq, unsigned int on);
 
+       void            (*bus_lock)(unsigned int irq);
+       void            (*bus_sync_unlock)(unsigned int irq);
+
        /* Currently used only by UML, might disappear one day.*/
 #ifdef CONFIG_IRQ_RELEASE_METHOD
        void            (*release)(unsigned int irq, void *dev_id);
@@ -157,7 +165,7 @@ struct irq_2_iommu;
  * @irqs_unhandled:    stats field for spurious unhandled interrupts
  * @lock:              locking for SMP
  * @affinity:          IRQ affinity on SMP
- * @cpu:               cpu index useful for balancing
+ * @node:              node index useful for balancing
  * @pending_mask:      pending rebalanced interrupts
  * @threads_active:    number of irqaction threads currently running
  * @wait_for_threads:  wait queue for sync_irq to wait for threaded handlers
@@ -184,7 +192,7 @@ struct irq_desc {
        unsigned int            irq_count;      /* For detecting broken IRQs */
        unsigned long           last_unhandled; /* Aging timer for unhandled count */
        unsigned int            irqs_unhandled;
-       spinlock_t              lock;
+       raw_spinlock_t          lock;
 #ifdef CONFIG_SMP
        cpumask_var_t           affinity;
        unsigned int            node;
@@ -220,13 +228,6 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node)
 extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node);
 
 /*
- * Migration helpers for obsolete names, they will go away:
- */
-#define hw_interrupt_type      irq_chip
-#define no_irq_type            no_irq_chip
-typedef struct irq_desc                irq_desc_t;
-
-/*
  * Pick up the arch-dependent methods:
  */
 #include <asm/hw_irq.h>
@@ -281,7 +282,7 @@ extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action);
 
 /*
  * Built-in IRQ handlers for various IRQ types,
- * callable via desc->chip->handle_irq()
+ * callable via desc->handle_irq()
  */
 extern void handle_level_irq(unsigned int irq, struct irq_desc *desc);
 extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc);
@@ -289,6 +290,7 @@ extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
 extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
 extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
 extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
+extern void handle_nested_irq(unsigned int irq);
 
 /*
  * Monolithic do_IRQ implementation.
@@ -379,6 +381,8 @@ set_irq_chained_handler(unsigned int irq,
        __set_irq_handler(irq, handle, 1, NULL);
 }
 
+extern void set_irq_nested_thread(unsigned int irq, int nest);
+
 extern void set_irq_noprobe(unsigned int irq);
 extern void set_irq_probe(unsigned int irq);
 
@@ -396,7 +400,9 @@ static inline int irq_has_action(unsigned int irq)
 
 /* Dynamic irq helper functions */
 extern void dynamic_irq_init(unsigned int irq);
+void dynamic_irq_init_keep_chip_data(unsigned int irq);
 extern void dynamic_irq_cleanup(unsigned int irq);
+void dynamic_irq_cleanup_keep_chip_data(unsigned int irq);
 
 /* Set/get chip/data for an IRQ: */
 extern int set_irq_chip(unsigned int irq, struct irq_chip *chip);
@@ -423,30 +429,26 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry);
 /**
  * alloc_desc_masks - allocate cpumasks for irq_desc
  * @desc:      pointer to irq_desc struct
- * @cpu:       cpu which will be handling the cpumasks
+ * @node:      node which will be handling the cpumasks
  * @boot:      true if need bootmem
  *
  * Allocates affinity and pending_mask cpumask if required.
  * Returns true if successful (or not required).
  */
 static inline bool alloc_desc_masks(struct irq_desc *desc, int node,
-                                                               bool boot)
+                                                       bool boot)
 {
-#ifdef CONFIG_CPUMASK_OFFSTACK
-       if (boot) {
-               alloc_bootmem_cpumask_var(&desc->affinity);
+       gfp_t gfp = GFP_ATOMIC;
 
-#ifdef CONFIG_GENERIC_PENDING_IRQ
-               alloc_bootmem_cpumask_var(&desc->pending_mask);
-#endif
-               return true;
-       }
+       if (boot)
+               gfp = GFP_NOWAIT;
 
-       if (!alloc_cpumask_var_node(&desc->affinity, GFP_ATOMIC, node))
+#ifdef CONFIG_CPUMASK_OFFSTACK
+       if (!alloc_cpumask_var_node(&desc->affinity, gfp, node))
                return false;
 
 #ifdef CONFIG_GENERIC_PENDING_IRQ
-       if (!alloc_cpumask_var_node(&desc->pending_mask, GFP_ATOMIC, node)) {
+       if (!alloc_cpumask_var_node(&desc->pending_mask, gfp, node)) {
                free_cpumask_var(desc->affinity);
                return false;
        }