|
@@ -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();
|