[PATCH] scsi: elx: efct: Restore config space after error-induced reset

Lukas Wunner <[email protected]> Tue, 5 May 2026 16:12:36 +0200
Newsgroups org.kernel.vger.target-devel,org.kernel.vger.linux-scsi
Message-ID <c57e018b4dee8d9d913870b8101ee9357c0c4a55.1777989011.git.lukas@wunner.de>
When a Fatal Error is handled by AER or DPC, the error-reporting PCIe
device is reset and its driver's ->slot_reset() callback is invoked to
bring the device back to working state.

That callback first needs to call pci_restore_state() to re-initialize
BAR assignments and other bits in config space.

The Emulex/Broadcom EFCT driver neglects to do that.  Fix it.

Fixes: 4df84e846624 ("scsi: elx: efct: Driver initialization routines")
Signed-off-by: Lukas Wunner <[email protected]>
Cc: [email protected] # v5.14+
---
Compile-tested only, I do not have this hardware available for testing.
That said, it seems the code path has never been tested anyway.
If you have the hardware, consider injecting a Fatal Error as described
in Documentation/PCI/pcieaer-howto.rst and see if the hardware recovers
successfully.

 drivers/scsi/elx/efct/efct_driver.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/elx/efct/efct_driver.c b/drivers/scsi/elx/efct/efct_driver.c
index 07c2f45..fe45009 100644
--- a/drivers/scsi/elx/efct/efct_driver.c
+++ b/drivers/scsi/elx/efct/efct_driver.c
@@ -688,6 +688,8 @@
 	int rc;
 	struct efct *efct = pci_get_drvdata(pdev);
 
+	pci_restore_state(pdev);
+
 	rc = pci_enable_device_mem(pdev);
 	if (rc) {
 		efc_log_err(efct, "failed to enable PCI device after reset\n");
-- 
2.51.0