arm: use cpu_online_mask when using forced irq_set_affinity
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 8 May 2014 18:04:00 +0000 (19:04 +0100)
committerLiviu Dudau <Liviu.Dudau@arm.com>
Mon, 12 May 2014 12:27:40 +0000 (13:27 +0100)
commit6578e2f954e8929b177e1ef45d3c5d9bf9a69011
treebf580c16b8bdddcebd7260802b43871edaa8081f
parent4fc2cef3b796f008df2071eb47e3638bd93c5374
arm: use cpu_online_mask when using forced irq_set_affinity

Commit 01f8fa4f01d8("genirq: Allow forcing cpu affinity of interrupts")
enabled the forced irq_set_affinity which previously refused to route an
interrupt to an offline cpu.

Commit ffde1de64012("irqchip: Gic: Support forced affinity setting")
implements this force logic and disables the cpu online check for GIC
interrupt controller.

When __cpu_disable calls migrate_irqs, it disables the current cpu in
cpu_online_mask and uses forced irq_set_affinity to migrate the IRQs
away from the cpu but passes affinity mask with the cpu being offlined
also included in it.

When calling irq_set_affinity with force == true in a cpu hotplug path,
the caller must ensure that the cpu being offlined is not present in the
affinity mask or it may be selected as the target CPU, leading to the
interrupt not being migrated.

This patch uses cpu_online_mask when using forced irq_set_affinity so
that the IRQs are properly migrated away.

Tested on TC2 hotpluging CPU0 in and out. Without this patch the system
locks up as the IRQs are not migrated away from CPU0.

Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
arch/arm/kernel/irq.c