[lkml]   [2022]   [Jul]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[irqchip: irq/irqchip-next] genirq: Provide an IRQ affinity mask in non-SMP configs
The following commit has been merged into the irq/irqchip-next branch of irqchip:

Commit-ID: aa0813581b8d37bdd91cd40b67ef79ffa45104b2
Author: Samuel Holland <>
AuthorDate: Fri, 01 Jul 2022 15:00:56 -05:00
Committer: Marc Zyngier <>
CommitterDate: Thu, 07 Jul 2022 09:38:04 +01:00

genirq: Provide an IRQ affinity mask in non-SMP configs

IRQ affinity masks are not allocated in uniprocessor configurations.
This requires special case non-SMP code in drivers for irqchips which
have per-CPU enable or mask registers.

Since IRQ affinity is always the same in a uniprocessor configuration,
we can provide a correct affinity mask without allocating one per IRQ.

By returning a real cpumask from irq_data_get_affinity_mask even when
SMP is disabled, irqchip drivers which iterate over that mask will
automatically do the right thing.

Signed-off-by: Samuel Holland <>
Signed-off-by: Marc Zyngier <>
include/linux/irq.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 02073f7..996e227 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -151,7 +151,9 @@ struct irq_common_data {
void *handler_data;
struct msi_desc *msi_desc;
+#ifdef CONFIG_SMP
cpumask_var_t affinity;
cpumask_var_t effective_affinity;
@@ -882,13 +884,19 @@ static inline int irq_data_get_node(struct irq_data *d)
static inline
const struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
+#ifdef CONFIG_SMP
return d->common->affinity;
+ return cpumask_of(0);

static inline void irq_data_update_affinity(struct irq_data *d,
const struct cpumask *m)
+#ifdef CONFIG_SMP
cpumask_copy(d->common->affinity, m);

static inline const struct cpumask *irq_get_affinity_mask(int irq)
 \ /
  Last update: 2022-07-07 10:51    [W:0.100 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site