linux-stable/include
Thomas Gleixner 77e89afc25 PCI/MSI: Protect msi_desc::masked for multi-MSI
Multi-MSI uses a single MSI descriptor and there is a single mask register
when the device supports per vector masking. To avoid reading back the mask
register the value is cached in the MSI descriptor and updates are done by
clearing and setting bits in the cache and writing it to the device.

But nothing protects msi_desc::masked and the mask register from being
modified concurrently on two different CPUs for two different Linux
interrupts which belong to the same multi-MSI descriptor.

Add a lock to struct device and protect any operation on the mask and the
mask register with it.

This makes the update of msi_desc::masked unconditional, but there is no
place which requires a modification of the hardware register without
updating the masked cache.

msi_mask_irq() is now an empty wrapper which will be cleaned up in follow
up changes.

The problem goes way back to the initial support of multi-MSI, but picking
the commit which introduced the mask cache is a valid cut off point
(2.6.30).

Fixes: f2440d9acb ("PCI MSI: Refactor interrupt masking code")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210729222542.726833414@linutronix.de
2021-08-10 10:59:20 +02:00
..
acpi ACPI: fix NULL pointer dereference 2021-07-24 15:25:54 -07:00
asm-generic This pull request contains the following changes for UML: 2021-07-09 10:19:13 -07:00
clocksource
crypto
drm drm: Return -ENOTTY for non-drm ioctls 2021-07-20 15:57:43 +02:00
dt-bindings dt-bindings: clock: r9a07g044-cpg: Update clock/reset definitions 2021-07-12 10:52:03 +02:00
keys
kunit linux-kselftest-kunit-fixes-5.14-rc1 2021-07-02 12:58:26 -07:00
kvm
linux PCI/MSI: Protect msi_desc::masked for multi-MSI 2021-08-10 10:59:20 +02:00
math-emu math-emu: Fix fall-through warning 2021-07-13 13:57:44 -05:00
media
memory
misc
net Networking fixes for 5.14-rc5, including fixes from ipsec. 2021-08-05 12:26:00 -07:00
pcmcia
ras
rdma
scsi SCSI misc on 20210702 2021-07-02 15:14:36 -07:00
soc Memory controller drivers for v5.14 - Tegra SoC, late fixes 2021-07-16 22:51:01 +02:00
sound ASoC: Fixes for v5.14 2021-07-21 19:48:09 +02:00
target
trace Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-07-22 10:11:27 -07:00
uapi dmaengine: idxd: Change license on idxd.h to LGPL 2021-07-28 10:22:43 -07:00
vdso
video
xen xen: sync include/xen/interface/io/ring.h with Xen's newest version 2021-07-05 09:49:45 +02:00