android_kernel_xiaomi_sm8350/drivers/base
Thomas Gleixner ec25d05e18 PCI/MSI: Protect msi_desc::masked for multi-MSI
commit 77e89afc25f30abd56e76a809ee2884d7c1b63ce upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-08-18 08:57:03 +02:00
..
firmware_loader firmware_loader: fix use-after-free in firmware_fallback_sysfs 2021-08-12 13:20:59 +02:00
power PM: runtime: Fix unpaired parent child_count for force_resume 2021-05-19 10:08:20 +02:00
regmap regmap: set debugfs_name to NULL after it is freed 2021-05-14 09:44:17 +02:00
test
arch_topology.c cpu-topology: Fix the potential data corruption 2020-10-01 13:17:40 +02:00
attribute_container.c
base.h
bus.c
cacheinfo.c
class.c
component.c
container.c
core.c PCI/MSI: Protect msi_desc::masked for multi-MSI 2021-08-18 08:57:03 +02:00
cpu.c x86/speculation: Add Special Register Buffer Data Sampling (SRBDS) mitigation 2020-06-10 20:24:57 +02:00
dd.c driver core: Fix locking bug in deferred_probe_timeout_work_func() 2021-04-16 11:46:38 +02:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c
module.c
node.c node: fix device cleanups in error handling code 2021-05-14 09:44:22 +02:00
pinctrl.c
platform-msi.c
platform.c drivers: base: Fix NULL pointer exception in __platform_driver_probe() if a driver developer is foolish 2020-06-24 17:50:24 +02:00
property.c
soc.c
swnode.c software node: Fix node registration 2021-03-17 17:03:48 +01:00
syscore.c
topology.c
transport_class.c