Skip to content

Commit 5e7371d

Browse files
wildea01Russell King
authored andcommitted
ARM: 7406/1: hotplug: copy the affinity mask when forcefully migrating IRQs
When a CPU is hotplugged off, we migrate any IRQs currently affine to it away and onto another online CPU by calling the irq_set_affinity function of the relevant interrupt controller chip. This function returns either IRQ_SET_MASK_OK or IRQ_SET_MASK_OK_NOCOPY, to indicate whether irq_data.affinity was updated. If we are forcefully migrating an interrupt (because the affinity mask no longer identifies any online CPUs) then we should update the IRQ affinity mask to reflect the new CPU set. Failure to do so can potentially leave /proc/irq/n/smp_affinity identifying only offline CPUs, which may confuse userspace IRQ balancing daemons. This patch updates migrate_one_irq to copy the affinity mask when the interrupt chip returns IRQ_SET_MASK_OK after forcefully changing the affinity of an interrupt. Cc: stable@vger.kernel.org Reported-by: Leif Lindholm <leif.lindholm@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent 6fa99b7 commit 5e7371d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎arch/arm/kernel/irq.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
155155
}
156156

157157
c = irq_data_get_irq_chip(d);
158-
if (c->irq_set_affinity)
159-
c->irq_set_affinity(d, affinity, true);
160-
else
158+
if (!c->irq_set_affinity)
161159
pr_debug("IRQ%u: unable to set affinity\n", d->irq);
160+
else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
161+
cpumask_copy(d->affinity, affinity);
162162

163163
return ret;
164164
}

0 commit comments

Comments
 (0)