summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Schnelle <schnelle@linux.ibm.com>2025-06-25 11:28:29 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 16:04:41 +0200
commita54280b0eb9988d1cbf4e186fe334ace221ddf2c (patch)
treecc589bddd9ea02eb10887e2132b6bb7c630ab316
parent2640c230aac454a23fed17a5e72a5f9216ddd955 (diff)
s390/pci: Do not try re-enabling load/store if device is disabled
commit b97a7972b1f4f81417840b9a2ab0c19722b577d5 upstream. If a device is disabled unblocking load/store on its own is not useful as a full re-enable of the function is necessary anyway. Note that SCLP Write Event Data Action Qualifier 0 (Reset) leaves the device disabled and triggers this case unless the driver already requests a reset. Cc: stable@vger.kernel.org Fixes: 4cdf2f4e24ff ("s390/pci: implement minimal PCI error recovery") 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/s390/pci/pci_event.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/s390/pci/pci_event.c b/arch/s390/pci/pci_event.c
index 9432fd407db6..ef44feb1a9da 100644
--- a/arch/s390/pci/pci_event.c
+++ b/arch/s390/pci/pci_event.c
@@ -105,6 +105,10 @@ static pci_ers_result_t zpci_event_do_error_state_clear(struct pci_dev *pdev,
struct zpci_dev *zdev = to_zpci(pdev);
int rc;
+ /* The underlying device may have been disabled by the event */
+ if (!zdev_enabled(zdev))
+ return PCI_ERS_RESULT_NEED_RESET;
+
pr_info("%s: Unblocking device access for examination\n", pci_name(pdev));
rc = zpci_reset_load_store_blocked(zdev);
if (rc) {