]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
s390/pci: tolerate inconsistent handle in recover
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 17 Mar 2022 15:34:58 +0000 (12:34 -0300)
committerPaolo Pisati <paolo.pisati@canonical.com>
Tue, 22 Mar 2022 16:57:29 +0000 (17:57 +0100)
commitfaf755de6f10c004a7b611d40bc5907c8abbe2d0
treec0dc18d27053184e95a9ee5c47c2c63fff97679a
parent92c07d71e1221537533eb5f0d8a374575b010b88
s390/pci: tolerate inconsistent handle in recover

BugLink: https://bugs.launchpad.net/bugs/1959532
Since commit 8256adda1f44 ("s390/pci: handle FH state mismatch only on
disable") zpci_disable_device() returns -EINVAL when the platform
detects an attempt to disable a PCI function that it sees as already
disabled.

In most situations we want to abort whenever this happens and abort is
possible since it either means that the device vanished but we haven't
gotten an availability event yet, or the FH got out of sync which should
not happen.

Unfortunately there is an inconsistency between the LPAR and z/VM
hypervisors on whether error events for PCI functions contain an
an enabled or a general handle. So under z/VM it can happen that our
most up to date function handle is enabled but trying to disable the
function results in the aforementioned error.

Since recover is designed to be used to recover functions from the error
state let's make it robust to this inconsistency by explicitly treating
it as a successful disable.

Acked-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
(cherry picked from commit 1c8174fdc798489159a79466fca782daa231219a)
Signed-off-by: Patricia Domingues <patricia.domingues@canonical.com>
Acked-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/s390/pci/pci_sysfs.c