]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - kernel/irq/manage.c
Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvar...
[karo-tx-linux.git] / kernel / irq / manage.c
index 6ead200370da0cfe15b9c6732ec5ec4e3a7523a9..841187239adc8e3bb0f72fb4ab0ca6a7fec2f618 100644 (file)
@@ -1743,6 +1743,31 @@ out:
 }
 EXPORT_SYMBOL_GPL(enable_percpu_irq);
 
+/**
+ * irq_percpu_is_enabled - Check whether the per cpu irq is enabled
+ * @irq:       Linux irq number to check for
+ *
+ * Must be called from a non migratable context. Returns the enable
+ * state of a per cpu interrupt on the current cpu.
+ */
+bool irq_percpu_is_enabled(unsigned int irq)
+{
+       unsigned int cpu = smp_processor_id();
+       struct irq_desc *desc;
+       unsigned long flags;
+       bool is_enabled;
+
+       desc = irq_get_desc_lock(irq, &flags, IRQ_GET_DESC_CHECK_PERCPU);
+       if (!desc)
+               return false;
+
+       is_enabled = cpumask_test_cpu(cpu, desc->percpu_enabled);
+       irq_put_desc_unlock(desc, flags);
+
+       return is_enabled;
+}
+EXPORT_SYMBOL_GPL(irq_percpu_is_enabled);
+
 void disable_percpu_irq(unsigned int irq)
 {
        unsigned int cpu = smp_processor_id();