path: root/kernel/irq
diff options
authorMatt Redfearn <>2016-04-21 10:08:32 +0100
committerThomas Gleixner <>2016-04-21 12:05:15 +0200
commit4589f450fb285ab85f7513b6649e51ec2a820653 (patch)
tree1160d87bfa592ecf06dc43425af4dec2f6f5977e /kernel/irq
parentc3b46c73264b03000d1e18b22f5caf63332547c9 (diff)
genirq: Dont allow affinity mask to be updated on IPIs
The IPI domain re-purposes the IRQ affinity to signify the mask of CPUs that this IPI will deliver to. This must not be modified before the IPI is destroyed again, so set the IRQ_NO_BALANCING flag to prevent the affinity being overwritten by setup_affinity(). Without this, if an IPI is reserved for a single target CPU, then allocated using __setup_irq(), the affinity is overwritten with cpu_online_mask. When ipi_destroy() is subsequently called on a multi-cpu system, it will attempt to free cpumask_weight() IRQs that were never allocated, and crash. Fixes: d17bf24e6952 ("genirq: Add a new generic IPI reservation code to irq core") Signed-off-by: Matt Redfearn <> Cc: Cc: Cc: Cc: Cc: Qais Yousef <> Cc: Link: Signed-off-by: Thomas Gleixner <>
Diffstat (limited to 'kernel/irq')
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/irq/ipi.c b/kernel/irq/ipi.c
index c37f34b00a11..14777af8e097 100644
--- a/kernel/irq/ipi.c
+++ b/kernel/irq/ipi.c
@@ -94,6 +94,7 @@ unsigned int irq_reserve_ipi(struct irq_domain *domain,
data = irq_get_irq_data(virq + i);
cpumask_copy(data->common->affinity, dest);
data->common->ipi_offset = offset;
+ irq_set_status_flags(virq + i, IRQ_NO_BALANCING);
return virq;