linux/drivers
Niklas Schnelle 76631ffa2f s390/ism: Fix and simplify add()/remove() callback handling
Previously the clients_lock was protecting the clients array against
concurrent addition/removal of clients but was also accessed from IRQ
context. This meant that it had to be a spinlock and that the add() and
remove() callbacks in which clients need to do allocation and take
mutexes can't be called under the clients_lock. To work around this these
callbacks were moved to workqueues. This not only introduced significant
complexity but is also subtly broken in at least one way.

In ism_dev_init() and ism_dev_exit() clients[i]->tgt_ism is used to
communicate the added/removed ISM device to the work function. While
write access to client[i]->tgt_ism is protected by the clients_lock and
the code waits that there is no pending add/remove work before and after
setting clients[i]->tgt_ism this is not enough. The problem is that the
wait happens based on per ISM device counters. Thus a concurrent
ism_dev_init()/ism_dev_exit() for a different ISM device may overwrite
a clients[i]->tgt_ism between unlocking the clients_lock and the
subsequent wait for the work to finnish.

Thankfully with the clients_lock no longer held in IRQ context it can be
turned into a mutex which can be held during the calls to add()/remove()
completely removing the need for the workqueues and the associated
broken housekeeping including the per ISM device counters and the
clients[i]->tgt_ism.

Fixes: 89e7d2ba61 ("net/ism: Add new API for client registration")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-07-08 10:07:14 +01:00
..
accel drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
accessibility
acpi RISC-V Patches for the 6.5 Merge Window, Part 1 2023-06-30 09:37:26 -07:00
amba
android
ata driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
atm
auxdisplay drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
base driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
bcma
block Networking changes for 6.5. 2023-06-28 16:43:10 -07:00
bluetooth Including fixes from bluetooth, bpf and wireguard. 2023-07-05 15:44:45 -07:00
bus Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
cdrom cdrom/gdrom: Fix build error 2023-06-29 08:09:31 -06:00
cdx
char virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
clk Another set of clk driver updates and fixes for the merge window. The 2023-07-04 11:07:45 -07:00
clocksource RISC-V Patches for the 6.5 Merge Window, Part 1 2023-06-30 09:37:26 -07:00
comedi comedi: make all 'class' structures const 2023-06-23 10:29:02 +02:00
connector
counter
cpufreq More power management updates for 6.5-rc1 2023-07-04 11:22:50 -07:00
cpuidle
crypto virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
cxl cxl: Fix one kernel-doc comment 2023-06-29 16:03:58 -07:00
dax dax: enable dax fault handler to report VM_FAULT_HWPOISON 2023-06-26 07:54:23 -06:00
dca
devfreq
dio
dma Scope-based Resource Management infrastructure 2023-07-04 13:50:38 -07:00
dma-buf drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
edac - Add initial support for RAS hardware found on AMD server GPUs (MI200). 2023-06-26 15:09:18 -07:00
eisa
extcon
firewire firewire: net: fix use after free in fwnet_finish_incoming_packet() 2023-06-24 14:03:46 +09:00
firmware Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
fpga Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
fsi
gnss
gpio Pin control changes for the v6.5 kernel cycle: 2023-06-30 14:57:19 -07:00
gpu dma-mapping uodates for Linux 6.5 2023-06-29 21:12:20 -07:00
greybus
hid drm changes for 6.5-rc1: 2023-06-29 11:00:17 -07:00
hsi
hte
hv
hwmon driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
hwspinlock
hwtracing Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
i2c Biggest news is not a patch this time 2023-07-02 10:22:38 -07:00
i3c
idle intel_idle: Add __init annotation to matchup_vm_state_with_baremetal() 2023-06-28 19:09:55 +02:00
iio driver core changes for 6.5-rc1 2023-07-03 12:56:23 -07:00
infiniband v6.5 merge window RDMA pull request 2023-06-29 21:01:17 -07:00
input ARM: SoC changes for 6.5 2023-06-29 15:28:33 -07:00
interconnect
iommu iommufd for 6.5 2023-06-29 20:57:27 -07:00
ipack
irqchip RISC-V Patches for the 6.5 Merge Window, Part 1 2023-06-30 09:37:26 -07:00
isdn
leds - New Drivers 2023-07-03 11:26:05 -07:00
macintosh macintosh: Use of_property_read_reg() to parse "reg" 2023-06-21 14:08:54 +10:00
mailbox mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0 2023-06-30 17:35:45 -05:00
mcb
md block-6.5-2023-07-03 2023-07-03 18:48:38 -07:00
media media updates for v6.5-rc1 2023-07-05 10:42:32 -07:00
memory Memory controller drivers for v6.5 2023-06-22 17:34:02 +02:00
memstick
message
mfd - New Drivers 2023-07-03 10:55:04 -07:00
misc Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
mmc gpio updates for v6.5 2023-06-29 10:11:10 -07:00
most
mtd Core MTD changes: 2023-06-28 14:02:03 -07:00
mux
net net: bgmac: postpone turning IRQs off to avoid SoC hangs 2023-07-08 10:02:15 +01:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-06-22 18:40:38 -07:00
ntb
nubus
nvdimm dax: enable dax fault handler to report VM_FAULT_HWPOISON 2023-06-26 07:54:23 -06:00
nvme Including fixes from bluetooth, bpf and wireguard. 2023-07-05 15:44:45 -07:00
nvmem
of Devicetree updates for v6.5: 2023-06-29 14:58:26 -07:00
opp OPP: Properly propagate error along when failing to get icc_path 2023-06-27 07:35:14 +05:30
parisc parisc: Move init function declarations into header file 2023-06-30 17:14:15 +02:00
parport Char/Misc and other driver subsystem updates for 6.5-rc1 2023-07-03 12:46:47 -07:00
pci pci-v6.5-changes 2023-06-30 15:06:45 -07:00
pcmcia
peci
perf cxl for v6.5 2023-07-01 08:58:41 -07:00
phy media updates for v6.5-rc1 2023-07-05 10:42:32 -07:00
pinctrl Pin control changes for the v6.5 kernel cycle: 2023-06-30 14:57:19 -07:00
platform USB / Thunderbolt driver updates for 6.5-rc1 2023-07-03 13:23:10 -07:00
pnp
power power supply and reset changes for the 6.5 series 2023-07-03 17:23:16 -07:00
powercap ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
pps
ps3
ptp ptp: Make max_phase_adjustment sysfs device attribute invisible when not supported 2023-07-03 13:17:25 -07:00
pwm pwm: Changes for v6.5-rc1 2023-07-05 12:55:06 -07:00
rapidio
ras
regulator - New Drivers 2023-07-03 10:55:04 -07:00
remoteproc remoteproc updates for v6.5 2023-07-03 17:03:05 -07:00
reset ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
rpmsg
rtc RTC for 6.5 2023-07-03 10:43:10 -07:00
s390 s390/ism: Fix and simplify add()/remove() callback handling 2023-07-08 10:07:14 +01:00
sbus oradax: make 'cl' a static const structure 2023-06-23 10:27:02 +02:00
scsi SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
sh
siox
slimbus
soc USB / Thunderbolt driver updates for 6.5-rc1 2023-07-03 13:23:10 -07:00
soundwire soundwire: stream: Make master_list ordered to prevent deadlocks 2023-06-21 16:31:45 +05:30
spi spi: Updates for v6.5 2023-06-28 13:48:42 -07:00
spmi
ssb
staging media updates for v6.5-rc1 2023-07-05 10:42:32 -07:00
target SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
tc
tee ARM: SoC drivers for 6.5 2023-06-29 15:22:19 -07:00
thermal Thermal control updates for 6.5-rc1 2023-06-26 19:41:26 -07:00
thunderbolt
tty TTY/Serial driver updates for 6.5-rc1. 2023-07-03 13:14:58 -07:00
ufs SCSI misc on 20230629 2023-06-30 11:57:07 -07:00
uio
usb USB / Thunderbolt driver updates for 6.5-rc1 2023-07-03 13:23:10 -07:00
vdpa virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
vfio VFIO updates for v6.5-rc1 2023-06-30 15:22:09 -07:00
vhost virtio: features, fixes, cleanups 2023-07-03 15:38:26 -07:00
video - New Functionality 2023-07-03 11:31:01 -07:00
virt workqueue: Ordered workqueue creation cleanups 2023-06-27 16:46:06 -07:00
virtio virtio: allow caller to override device DMA mask in vp_modern 2023-06-27 10:47:08 -04:00
vlynq
w1
watchdog
xen - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
zorro
Kconfig
Makefile