Skip to content

Commit aa08135

Browse files
smaeulMarc Zyngier
authored andcommitted
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 <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 4d0b829 commit aa08135

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/linux/irq.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ struct irq_common_data {
151151
#endif
152152
void *handler_data;
153153
struct msi_desc *msi_desc;
154+
#ifdef CONFIG_SMP
154155
cpumask_var_t affinity;
156+
#endif
155157
#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK
156158
cpumask_var_t effective_affinity;
157159
#endif
@@ -882,13 +884,19 @@ static inline int irq_data_get_node(struct irq_data *d)
882884
static inline
883885
const struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
884886
{
887+
#ifdef CONFIG_SMP
885888
return d->common->affinity;
889+
#else
890+
return cpumask_of(0);
891+
#endif
886892
}
887893

888894
static inline void irq_data_update_affinity(struct irq_data *d,
889895
const struct cpumask *m)
890896
{
897+
#ifdef CONFIG_SMP
891898
cpumask_copy(d->common->affinity, m);
899+
#endif
892900
}
893901

894902
static inline const struct cpumask *irq_get_affinity_mask(int irq)

0 commit comments

Comments
 (0)