]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/powerpc/kernel/irq.c
powerpc: Use static const char arrays
[karo-tx-linux.git] / arch / powerpc / kernel / irq.c
index 77be3d058a658fa447a2235a8441d320be245d20..47fbc56e9e1c9462d86621c0160d8ce2337a9e66 100644 (file)
@@ -53,6 +53,8 @@
 #include <linux/bootmem.h>
 #include <linux/pci.h>
 #include <linux/debugfs.h>
+#include <linux/of.h>
+#include <linux/of_irq.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -64,6 +66,9 @@
 #include <asm/ptrace.h>
 #include <asm/machdep.h>
 #include <asm/udbg.h>
+#include <asm/dbell.h>
+#include <asm/smp.h>
+
 #ifdef CONFIG_PPC64
 #include <asm/paca.h>
 #include <asm/firmware.h>
@@ -153,14 +158,28 @@ notrace void raw_local_irq_restore(unsigned long en)
        if (get_hard_enabled())
                return;
 
+#if defined(CONFIG_BOOKE) && defined(CONFIG_SMP)
+       /* Check for pending doorbell interrupts and resend to ourself */
+       doorbell_check_self();
+#endif
+
        /*
         * Need to hard-enable interrupts here.  Since currently disabled,
         * no need to take further asm precautions against preemption; but
         * use local_paca instead of get_paca() to avoid preemption checking.
         */
        local_paca->hard_enabled = en;
+
+#ifndef CONFIG_BOOKE
+       /* On server, re-trigger the decrementer if it went negative since
+        * some processors only trigger on edge transitions of the sign bit.
+        *
+        * BookE has a level sensitive decrementer (latches in TSR) so we
+        * don't need that
+        */
        if ((int)mfspr(SPRN_DEC) < 0)
                mtspr(SPRN_DEC, 1);
+#endif /* CONFIG_BOOKE */
 
        /*
         * Force the delivery of pending soft-disabled interrupts on PS3.
@@ -428,22 +447,23 @@ struct thread_info *mcheckirq_ctx[NR_CPUS] __read_mostly;
 void exc_lvl_ctx_init(void)
 {
        struct thread_info *tp;
-       int i;
+       int i, hw_cpu;
 
        for_each_possible_cpu(i) {
-               memset((void *)critirq_ctx[i], 0, THREAD_SIZE);
-               tp = critirq_ctx[i];
+               hw_cpu = get_hard_smp_processor_id(i);
+               memset((void *)critirq_ctx[hw_cpu], 0, THREAD_SIZE);
+               tp = critirq_ctx[hw_cpu];
                tp->cpu = i;
                tp->preempt_count = 0;
 
 #ifdef CONFIG_BOOKE
-               memset((void *)dbgirq_ctx[i], 0, THREAD_SIZE);
-               tp = dbgirq_ctx[i];
+               memset((void *)dbgirq_ctx[hw_cpu], 0, THREAD_SIZE);
+               tp = dbgirq_ctx[hw_cpu];
                tp->cpu = i;
                tp->preempt_count = 0;
 
-               memset((void *)mcheckirq_ctx[i], 0, THREAD_SIZE);
-               tp = mcheckirq_ctx[i];
+               memset((void *)mcheckirq_ctx[hw_cpu], 0, THREAD_SIZE);
+               tp = mcheckirq_ctx[hw_cpu];
                tp->cpu = i;
                tp->preempt_count = HARDIRQ_OFFSET;
 #endif
@@ -804,18 +824,6 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
 }
 EXPORT_SYMBOL_GPL(irq_create_of_mapping);
 
-unsigned int irq_of_parse_and_map(struct device_node *dev, int index)
-{
-       struct of_irq oirq;
-
-       if (of_irq_map_one(dev, index, &oirq))
-               return NO_IRQ;
-
-       return irq_create_of_mapping(oirq.controller, oirq.specifier,
-                                    oirq.size);
-}
-EXPORT_SYMBOL_GPL(irq_of_parse_and_map);
-
 void irq_dispose_mapping(unsigned int virq)
 {
        struct irq_host *host;
@@ -1135,7 +1143,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
        unsigned long flags;
        struct irq_desc *desc;
        const char *p;
-       char none[] = "none";
+       static const char none[] = "none";
        int i;
 
        seq_printf(m, "%-5s  %-7s  %-15s  %s\n", "virq", "hwirq",