• Sudeep Holla's avatar
    ARM: 8133/1: use irq_set_affinity with force=false when migrating irqs · a040803a
    Sudeep Holla authored
    Since commit 1dbfa187 ("ARM: irq migration: force migration off CPU
    going down") the ARM interrupt migration code on cpu offline calls
    irqchip.irq_set_affinity() with the argument force=true. At the point
    of this change the argument had no effect because it was not used by
    any interrupt chip driver and there was no semantics defined.
    
    This changed with commit 01f8fa4f ("genirq: Allow forcing cpu
    affinity of interrupts") which made the force argument useful to route
    interrupts to not yet online cpus without checking the target cpu
    against the cpu online mask. The following commit ffde1de6
    ("irqchip: gic: Support forced affinity setting") implemented this for
    the GIC interrupt controller.
    
    As a consequence the ARM cpu offline irq migration fails if CPU0 is
    offlined, because CPU0 is still set in the affinity mask and the
    validataion against cpu online mask is skipped to the force argument
    being true. The following first_cpu(mask) selection always selects
    CPU0 as the target.
    
    Solve the issue by calling irq_set_affinity() with force=false from
    the CPU offline irq migration code so the GIC driver validates the
    affinity mask against CPU online mask and therefore removes CPU0 from
    the possible target candidates.
    
    Tested on TC2 hotpluging CPU0 in and out. Without this patch the system
    locks up as the IRQs are not migrated away from CPU0.
    Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
    Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: <stable@vger.kernel.org> # 3.10.x
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    a040803a
irq.c 5.43 KB