linux/arch/s390
Niklas Schnelle c4a585e952 s390/pci: Fix potential double remove of hotplug slot
In commit 6ee600bfbe ("s390/pci: remove hotplug slot when releasing the
device") the zpci_exit_slot() was moved from zpci_device_reserved() to
zpci_release_device() with the intention of keeping the hotplug slot
around until the device is actually removed.

Now zpci_release_device() is only called once all references are
dropped. Since the zPCI subsystem only drops its reference once the
device is in the reserved state it follows that zpci_release_device()
must only deal with devices in the reserved state. Despite that it
contains code to tear down from both configured and standby state. For
the standby case this already includes the removal of the hotplug slot
so would cause a double removal if a device was ever removed in
either configured or standby state.

Instead of causing a potential double removal in a case that should
never happen explicitly WARN_ON() if a device in non-reserved state is
released and get rid of the dead code cases.

Fixes: 6ee600bfbe ("s390/pci: remove hotplug slot when releasing the device")
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Tested-by: Gerd Bayer <gbayer@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
2024-11-28 14:12:04 +01:00
..
appldata sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
boot s390/mm: Allow large pages for KASAN shadow mapping 2024-11-24 16:59:51 +01:00
configs s390 updates for 6.13 merge window 2024-11-18 17:45:41 -08:00
crypto s390/crypto: Add hardware acceleration for full AES-XTS mode 2024-10-29 11:17:19 +01:00
hypfs [tree-wide] finally take no_llseek out 2024-09-27 08:18:43 -07:00
include s390/mm/hugetlbfs: Add missing includes 2024-11-28 14:11:44 +01:00
kernel s390/entry: Mark IRQ entries to fix stack depot warnings 2024-11-21 12:44:07 +01:00
kvm KVM: s390: Remove one byte cmpxchg() usage 2024-11-27 12:55:15 +01:00
lib s390/string: Convert to use flag output macros 2024-11-13 14:31:33 +01:00
mm s390/mm: Add PTE_MARKER support for hugetlbfs mappings 2024-11-27 12:57:01 +01:00
net s390/bpf: Implement exceptions 2024-07-08 16:39:35 +02:00
pci s390/pci: Fix potential double remove of hotplug slot 2024-11-28 14:12:04 +01:00
purgatory s390: Fix various typos 2024-10-25 16:03:23 +02:00
tools s390 updates for 6.12 merge window 2024-09-21 09:02:54 -07:00
Kbuild - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
Kconfig s390: Add ARCH_HAS_PREEMPT_LAZY support 2024-11-24 16:59:42 +01:00
Kconfig.debug s390/Kconfig.debug: fix indentation 2022-06-01 12:03:15 +02:00
Makefile s390: use a larger stack for KMSAN 2024-07-03 19:30:24 -07:00
Makefile.postlink s390/build: Avoid relocation information in final vmlinux 2024-08-27 20:16:48 +02:00