linux/arch/x86/kernel/apic
Thomas Gleixner f0c7baca18 genirq/affinity: Make affinity setting if activated opt-in
John reported that on a RK3288 system the perf per CPU interrupts are all
affine to CPU0 and provided the analysis:

 "It looks like what happens is that because the interrupts are not per-CPU
  in the hardware, armpmu_request_irq() calls irq_force_affinity() while
  the interrupt is deactivated and then request_irq() with IRQF_PERCPU |
  IRQF_NOBALANCING.  

  Now when irq_startup() runs with IRQ_STARTUP_NORMAL, it calls
  irq_setup_affinity() which returns early because IRQF_PERCPU and
  IRQF_NOBALANCING are set, leaving the interrupt on its original CPU."

This was broken by the recent commit which blocked interrupt affinity
setting in hardware before activation of the interrupt. While this works in
general, it does not work for this particular case. As contrary to the
initial analysis not all interrupt chip drivers implement an activate
callback, the safe cure is to make the deferred interrupt affinity setting
at activation time opt-in.

Implement the necessary core logic and make the two irqchip implementations
for which this is required opt-in. In hindsight this would have been the
right thing to do, but ...

Fixes: baedb87d1b ("genirq/affinity: Handle affinity setting on inactive interrupts correctly")
Reported-by: John Keeping <john@metanate.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marc Zyngier <maz@kernel.org>
Acked-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/87blk4tzgm.fsf@nanos.tec.linutronix.de
2020-07-27 16:20:40 +02:00
..
apic.c The X86 entry, exception and interrupt code rework 2020-06-13 10:05:47 -07:00
apic_common.c x86/apic: Fix signedness bug in APIC ID validity checks 2018-04-10 16:46:39 +02:00
apic_flat_64.c x86/apic/flat64: Remove the IPI shorthand decision logic 2019-07-25 16:12:02 +02:00
apic_noop.c x86/apic: Cleanup the include maze 2019-07-25 16:11:57 +02:00
apic_numachip.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
bigsmp_32.c Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:04:39 -07:00
hw_nmi.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
io_apic.c irqdomain/treewide: Free firmware node after domain removal 2020-07-23 00:08:52 +02:00
ipi.c x86/apic: Share common IPI helpers 2019-07-25 16:12:02 +02:00
local.h x86/apic/x2apic: Implement IPI shorthands support 2019-07-25 16:12:02 +02:00
Makefile x86/PCI: Remove unused HyperTransport interrupt support 2017-11-23 20:18:18 +01:00
msi.c irqdomain/treewide: Keep firmware node unconditionally allocated 2020-07-14 17:44:42 +02:00
probe_32.c Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2019-09-17 12:04:39 -07:00
probe_64.c x86/apic/flat64: Remove the IPI shorthand decision logic 2019-07-25 16:12:02 +02:00
vector.c genirq/affinity: Make affinity setting if activated opt-in 2020-07-27 16:20:40 +02:00
x2apic_cluster.c x86/apic/x2apic: Fix a NULL pointer deref when handling a dying cpu 2019-10-15 10:57:09 +02:00
x2apic_phys.c x86/apic/x2apic: Implement IPI shorthands support 2019-07-25 16:12:02 +02:00
x2apic_uv_x.c x86/apic/uv: Remove code for unused distributed GRU mode 2020-05-23 16:19:57 +02:00