Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.git] / kernel / smp.c
index 06d574e42c7255a3186ef4c26f9c0927eb534070..306f8180b0d53165c960d7844295d8c6a4d6151a 100644 (file)
@@ -185,14 +185,26 @@ void generic_smp_call_function_single_interrupt(void)
 {
        struct llist_node *entry;
        struct call_single_data *csd, *csd_next;
+       static bool warned;
+
+       entry = llist_del_all(&__get_cpu_var(call_single_queue));
+       entry = llist_reverse_order(entry);
 
        /*
         * Shouldn't receive this interrupt on a cpu that is not yet online.
         */
-       WARN_ON_ONCE(!cpu_online(smp_processor_id()));
+       if (unlikely(!cpu_online(smp_processor_id()) && !warned)) {
+               warned = true;
+               WARN(1, "IPI on offline CPU %d\n", smp_processor_id());
 
-       entry = llist_del_all(&__get_cpu_var(call_single_queue));
-       entry = llist_reverse_order(entry);
+               /*
+                * We don't have to use the _safe() variant here
+                * because we are not invoking the IPI handlers yet.
+                */
+               llist_for_each_entry(csd, entry, llist)
+                       pr_warn("IPI callback %pS sent to offline CPU\n",
+                               csd->func);
+       }
 
        llist_for_each_entry_safe(csd, csd_next, entry, llist) {
                csd->func(csd->info);