genirq/generic_pending: Do not lose pending affinity update
authorThomas Gleixner <tglx@linutronix.de>
Mon, 4 Jun 2018 15:33:54 +0000 (17:33 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 6 Jun 2018 13:18:19 +0000 (15:18 +0200)
commita33a5d2d16cb84bea8d5f5510f3a41aa48b5c467
tree3414f6aaf8ee8d69d9b04266b3cdd6db024242d5
parent80ae7b1a918e78b0bae88b0c0ad413d3fdced968
genirq/generic_pending: Do not lose pending affinity update

The generic pending interrupt mechanism moves interrupts from the interrupt
handler on the original target CPU to the new destination CPU. This is
required for x86 and ia64 due to the way the interrupt delivery and
acknowledge works if the interrupts are not remapped.

However that update can fail for various reasons. Some of them are valid
reasons to discard the pending update, but the case, when the previous move
has not been fully cleaned up is not a legit reason to fail.

Check the return value of irq_do_set_affinity() for -EBUSY, which indicates
a pending cleanup, and rearm the pending move in the irq dexcriptor so it's
tried again when the next interrupt arrives.

Fixes: 996c591227d9 ("x86/irq: Plug vector cleanup race")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Song Liu <songliubraving@fb.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <liu.song.a23@gmail.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: stable@vger.kernel.org
Cc: Mike Travis <mike.travis@hpe.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Tariq Toukan <tariqt@mellanox.com>
Link: https://lkml.kernel.org/r/20180604162224.386544292@linutronix.de
kernel/irq/migration.c