]> www.infradead.org Git - users/jedix/linux-maple.git/commit
s390/pci: Fix stale function handles in error handling
authorNiklas Schnelle <schnelle@linux.ibm.com>
Wed, 25 Jun 2025 09:28:28 +0000 (11:28 +0200)
committerAlexander Gordeev <agordeev@linux.ibm.com>
Sat, 28 Jun 2025 16:58:59 +0000 (18:58 +0200)
commit45537926dd2aaa9190ac0fac5a0fbeefcadfea95
tree99dac10febd94bdf257eaa402429feaf1096ca77
parent7f8073cfb04a97842fe891ca50dad60afd1e3121
s390/pci: Fix stale function handles in error handling

The error event information for PCI error events contains a function
handle for the respective function. This handle is generally captured at
the time the error event was recorded. Due to delays in processing or
cascading issues, it may happen that during firmware recovery multiple
events are generated. When processing these events in order Linux may
already have recovered an affected function making the event information
stale. Fix this by doing an unconditional CLP List PCI function
retrieving the current function handle with the zdev->state_lock held
and ignoring the event if its function handle is stale.

Cc: stable@vger.kernel.org
Fixes: 4cdf2f4e24ff ("s390/pci: implement minimal PCI error recovery")
Reviewed-by: Julian Ruess <julianr@linux.ibm.com>
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
arch/s390/pci/pci_event.c