Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / kernel / irq_work.c
index 345d19edcdaed81a5c0194fb9256f3b113b7f402..3ab9048483fa9c9041747b10bd0c8ec192b9a413 100644 (file)
@@ -115,8 +115,10 @@ bool irq_work_needs_cpu(void)
 
        raised = this_cpu_ptr(&raised_list);
        lazy = this_cpu_ptr(&lazy_list);
-       if (llist_empty(raised) && llist_empty(lazy))
-               return false;
+
+       if (llist_empty(raised) || arch_irq_work_has_interrupt())
+               if (llist_empty(lazy))
+                       return false;
 
        /* All work should have been flushed before going offline */
        WARN_ON_ONCE(cpu_is_offline(smp_processor_id()));
@@ -171,6 +173,15 @@ void irq_work_run(void)
 }
 EXPORT_SYMBOL_GPL(irq_work_run);
 
+void irq_work_tick(void)
+{
+       struct llist_head *raised = &__get_cpu_var(raised_list);
+
+       if (!llist_empty(raised) && !arch_irq_work_has_interrupt())
+               irq_work_run_list(raised);
+       irq_work_run_list(&__get_cpu_var(lazy_list));
+}
+
 /*
  * Synchronize against the irq_work @entry, ensures the entry is not
  * currently in use.