]> git.baikalelectronics.ru Git - kernel.git/commit
s390/pci: tolerate inconsistent handle in recover
authorNiklas Schnelle <schnelle@linux.ibm.com>
Tue, 7 Sep 2021 14:43:29 +0000 (16:43 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Mon, 4 Oct 2021 07:49:36 +0000 (09:49 +0200)
commit9af766fafbb69e1883ae2b8655b97b9f57fe59da
tree6913106928ed29c2ca6b16cb4c45b43076027f6f
parent6f66b8183d1c9bda36e443f60e3ea45d8ee13c47
s390/pci: tolerate inconsistent handle in recover

Since commit 7e06dc1fd5e7 ("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>
arch/s390/pci/pci_sysfs.c