linux-stable/include
Thomas Gleixner 6a7a29935d genirq/affinity: Make affinity setting if activated opt-in
commit f0c7baca18 upstream.

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
[fllinden@amazon.com - backported to 4.14]
Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-08-21 09:48:23 +02:00
..
acpi x86: ACPI: fix CPU hotplug deadlock 2020-04-24 08:01:20 +02:00
asm-generic x86, vmlinux.lds: Page-align end of ..page_aligned sections 2020-08-05 10:06:49 +02:00
clocksource
crypto crypto: af_alg - fix use-after-free in af_alg_accept() due to bh_lock_sock() 2020-07-09 09:36:30 +02:00
drm drm: mst: Fix query_payload ack reply struct 2019-12-31 12:36:46 +01:00
dt-bindings dt-bindings: reset: meson8b: fix duplicate reset IDs 2020-01-23 08:20:29 +01:00
keys KEYS: Don't write out to userspace while holding key semaphore 2020-04-24 08:01:25 +02:00
kvm KVM: arm/arm64: Sync ICH_VMCR_EL2 back when about to block 2019-08-25 10:50:18 +02:00
linux genirq/affinity: Make affinity setting if activated opt-in 2020-08-21 09:48:23 +02:00
math-emu math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning 2019-12-17 20:38:02 +01:00
media media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros 2020-02-28 16:36:00 +01:00
memory
misc
net net/compat: Add missing sock updates for SCM_RIGHTS 2020-08-21 09:48:18 +02:00
pcmcia
ras
rdma IB/mlx4: Avoid implicit enumerated type conversion 2019-11-24 08:23:05 +01:00
scsi Revert "scsi: libsas: direct call probe and destruct" 2020-08-07 09:38:40 +02:00
soc
sound ALSA: compress: fix partial_drain completion state 2020-07-22 09:22:17 +02:00
target scsi: target: fix hang when multiple threads try to destroy the same iscsi session 2020-04-24 08:00:58 +02:00
trace rxrpc: Fix trace string 2020-07-22 09:22:29 +02:00
uapi wireless: Use offsetof instead of custom macro. 2020-08-05 10:06:48 +02:00
video
xen xen/events: fix binding user event channels to cpus 2019-07-31 07:28:39 +02:00