]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
PCI/AER: Fix missing uevent on recovery when a reset is requested
authorNiklas Schnelle <schnelle@linux.ibm.com>
Thu, 7 Aug 2025 13:55:38 +0000 (15:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 19 Oct 2025 14:21:48 +0000 (16:21 +0200)
commit bbf7d0468d0da71d76cc6ec9bc8a224325d07b6b upstream.

Since commit 7b42d97e99d3 ("PCI/ERR: Always report current recovery
status for udev") AER uses the result of error_detected() as parameter
to pci_uevent_ers(). As pci_uevent_ers() however does not handle
PCI_ERS_RESULT_NEED_RESET this results in a missing uevent for the
beginning of recovery if drivers request a reset. Fix this by treating
PCI_ERS_RESULT_NEED_RESET as beginning recovery.

Fixes: 7b42d97e99d3 ("PCI/ERR: Always report current recovery status for udev")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20250807-add_err_uevents-v5-1-adf85b0620b0@linux.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/pci-driver.c

index 46b82bacaff68a1c4bb0ea7ef24eb596503eb0c8..1330a29e5747ad9784ccfbf2d0a50c97051c108f 100644 (file)
@@ -1561,6 +1561,7 @@ void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type)
        switch (err_type) {
        case PCI_ERS_RESULT_NONE:
        case PCI_ERS_RESULT_CAN_RECOVER:
+       case PCI_ERS_RESULT_NEED_RESET:
                envp[idx++] = "ERROR_EVENT=BEGIN_RECOVERY";
                envp[idx++] = "DEVICE_ONLINE=0";
                break;