]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/softirq.c
[ARM] 3690/1: genirq: Introduce and make use of dummy irq chip
[karo-tx-linux.git] / kernel / softirq.c
index ad3295cdded55032f248bf53dc6b908c56702581..8f03e3b89b5540a0e21b1bab99dcb455bb74ffd5 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/cpu.h>
 #include <linux/kthread.h>
 #include <linux/rcupdate.h>
+#include <linux/smp.h>
 
 #include <asm/irq.h>
 /*
@@ -469,6 +470,8 @@ static int __devinit cpu_callback(struct notifier_block *nfb,
                break;
 #ifdef CONFIG_HOTPLUG_CPU
        case CPU_UP_CANCELED:
+               if (!per_cpu(ksoftirqd, hotcpu))
+                       break;
                /* Unbind so it can run.  Fall thru. */
                kthread_bind(per_cpu(ksoftirqd, hotcpu),
                             any_online_cpu(cpu_online_map));
@@ -495,3 +498,22 @@ __init int spawn_ksoftirqd(void)
        register_cpu_notifier(&cpu_nfb);
        return 0;
 }
+
+#ifdef CONFIG_SMP
+/*
+ * Call a function on all processors
+ */
+int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait)
+{
+       int ret = 0;
+
+       preempt_disable();
+       ret = smp_call_function(func, info, retry, wait);
+       local_irq_disable();
+       func(info);
+       local_irq_enable();
+       preempt_enable();
+       return ret;
+}
+EXPORT_SYMBOL(on_each_cpu);
+#endif