summaryrefslogtreecommitdiffstats
path: root/include/linux/interrupt.h
diff options
context:
space:
mode:
authorEyal Perry <eyalpe@mellanox.com>2014-05-20 17:57:00 +0300
committerThomas Gleixner <tglx@linutronix.de>2014-05-21 11:31:51 +0900
commitf0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de (patch)
treea4f21b235e5e1032230f2a640170cda56fec7afd /include/linux/interrupt.h
parentd6d211db37e75de2ddc3a4f979038c40df7cc79c (diff)
downloadlinux-f0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de.tar.gz
linux-f0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de.tar.bz2
linux-f0ba3d05c9c647ab42ed6a0dbdfdeae42bfbd6de.zip
genirq: Provide !SMP stub for irq_set_affinity_notifier()
Instead of requiring each consumer of the IRQ affinity notifier to have themselves be explicitly dependent on CONFIG_SMP, make the definition of struct irq_affinity_notify to exist independently of that config option and introduce a stub for irq_set_affinity_notifier() under non SMP configuration. Fixes: 2eacc23 ("net/mlx4_core: Enforce irq affinity changes immediatly") Signed-off-by: Eyal Perry <eyalpe@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Cc: Yevgeny Petrilin <yevgenyp@mellanox.com> Cc: Or Gerlitz <ogerlitz@mellanox.com> Cc: David S. Miller <davem@davemloft.net> Link: http://lkml.kernel.org/r/1400597820-30685-1-git-send-email-amirv@mellanox.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux/interrupt.h')
-rw-r--r--include/linux/interrupt.h46
1 files changed, 26 insertions, 20 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 97ac926c78a7..3f74c0593171 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -199,6 +199,26 @@ extern int check_wakeup_irqs(void);
static inline int check_wakeup_irqs(void) { return 0; }
#endif
+/**
+ * struct irq_affinity_notify - context for notification of IRQ affinity changes
+ * @irq: Interrupt to which notification applies
+ * @kref: Reference count, for internal use
+ * @work: Work item, for internal use
+ * @notify: Function to be called on change. This will be
+ * called in process context.
+ * @release: Function to be called on release. This will be
+ * called in process context. Once registered, the
+ * structure must only be freed when this function is
+ * called or later.
+ */
+struct irq_affinity_notify {
+ unsigned int irq;
+ struct kref kref;
+ struct work_struct work;
+ void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
+ void (*release)(struct kref *ref);
+};
+
#if defined(CONFIG_SMP)
extern cpumask_var_t irq_default_affinity;
@@ -242,26 +262,6 @@ extern int irq_select_affinity(unsigned int irq);
extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
-/**
- * struct irq_affinity_notify - context for notification of IRQ affinity changes
- * @irq: Interrupt to which notification applies
- * @kref: Reference count, for internal use
- * @work: Work item, for internal use
- * @notify: Function to be called on change. This will be
- * called in process context.
- * @release: Function to be called on release. This will be
- * called in process context. Once registered, the
- * structure must only be freed when this function is
- * called or later.
- */
-struct irq_affinity_notify {
- unsigned int irq;
- struct kref kref;
- struct work_struct work;
- void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
- void (*release)(struct kref *ref);
-};
-
extern int
irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
@@ -284,6 +284,12 @@ static inline int irq_set_affinity_hint(unsigned int irq,
{
return -EINVAL;
}
+
+static inline int
+irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify)
+{
+ return 0;
+}
#endif /* CONFIG_SMP */
/*