]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/irq/chip.c
Merge branch 'master' into upstream
[mv-sheeva.git] / kernel / irq / chip.c
index 8736f2ca8a3bca6d07f5dc768fb801efe5cb1878..9336f2e89e40210a3265092135c3060f4fcf251c 100644 (file)
@@ -261,10 +261,13 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc, struct pt_regs *regs)
         * keep it masked and get out of here
         */
        action = desc->action;
-       if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
+               desc->status |= IRQ_PENDING;
                goto out;
+       }
 
        desc->status |= IRQ_INPROGRESS;
+       desc->status &= ~IRQ_PENDING;
        spin_unlock(&desc->lock);
 
        action_ret = handle_IRQ_event(irq, regs, action);
@@ -280,18 +283,18 @@ out:
 }
 
 /**
- *     handle_fastack_irq - irq handler for transparent controllers
+ *     handle_fasteoi_irq - irq handler for transparent controllers
  *     @irq:   the interrupt number
  *     @desc:  the interrupt description structure for this irq
  *     @regs:  pointer to a register structure
  *
- *     Only a single callback will be issued to the chip: an ->ack()
+ *     Only a single callback will be issued to the chip: an ->eoi()
  *     call when the interrupt has been serviced. This enables support
  *     for modern forms of interrupt handlers, which handle the flow
  *     details in hardware, transparently.
  */
 void fastcall
-handle_fastack_irq(unsigned int irq, struct irq_desc *desc,
+handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc,
                   struct pt_regs *regs)
 {
        unsigned int cpu = smp_processor_id();
@@ -311,10 +314,13 @@ handle_fastack_irq(unsigned int irq, struct irq_desc *desc,
         * keep it masked and get out of here
         */
        action = desc->action;
-       if (unlikely(!action || (desc->status & IRQ_DISABLED)))
+       if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
+               desc->status |= IRQ_PENDING;
                goto out;
+       }
 
        desc->status |= IRQ_INPROGRESS;
+       desc->status &= ~IRQ_PENDING;
        spin_unlock(&desc->lock);
 
        action_ret = handle_IRQ_event(irq, regs, action);
@@ -324,10 +330,7 @@ handle_fastack_irq(unsigned int irq, struct irq_desc *desc,
        spin_lock(&desc->lock);
        desc->status &= ~IRQ_INPROGRESS;
 out:
-       if (!(desc->status & IRQ_DISABLED))
-               desc->chip->ack(irq);
-       else
-               desc->chip->mask(irq);
+       desc->chip->eoi(irq);
 
        spin_unlock(&desc->lock);
 }
@@ -462,9 +465,18 @@ __set_irq_handler(unsigned int irq,
        if (!handle)
                handle = handle_bad_irq;
 
-       if (is_chained && desc->chip == &no_irq_chip)
-               printk(KERN_WARNING "Trying to install "
-                      "chained interrupt type for IRQ%d\n", irq);
+       if (desc->chip == &no_irq_chip) {
+               printk(KERN_WARNING "Trying to install %sinterrupt handler "
+                      "for IRQ%d\n", is_chained ? "chained " : " ", irq);
+               /*
+                * Some ARM implementations install a handler for really dumb
+                * interrupt hardware without setting an irq_chip. This worked
+                * with the ARM no_irq_chip but the check in setup_irq would
+                * prevent us to setup the interrupt at all. Switch it to
+                * dummy_irq_chip for easy transition.
+                */
+               desc->chip = &dummy_irq_chip;
+       }
 
        spin_lock_irqsave(&desc->lock, flags);
 
@@ -507,19 +519,19 @@ handle_irq_name(void fastcall (*handle)(unsigned int, struct irq_desc *,
                                        struct pt_regs *))
 {
        if (handle == handle_level_irq)
-               return "level ";
-       if (handle == handle_fastack_irq)
-               return "level ";
+               return "level  ";
+       if (handle == handle_fasteoi_irq)
+               return "fasteoi";
        if (handle == handle_edge_irq)
-               return "edge  ";
+               return "edge   ";
        if (handle == handle_simple_irq)
-               return "simple";
+               return "simple ";
 #ifdef CONFIG_SMP
        if (handle == handle_percpu_irq)
-               return "percpu";
+               return "percpu ";
 #endif
        if (handle == handle_bad_irq)
-               return "bad   ";
+               return "bad    ";
 
        return NULL;
 }