igb_rd32() sets hw->hw_addr to NULL when a register read returns
all-ones, after which every register access is a no-op. __igb_resume()
restores PCI state and re-attaches the netdev but never restores
hw_addr, so an adapter that saw a single failed read stays unusable
across suspend/resume while appearing attached. Only
igb_io_slot_reset() restores it today.
Restore hw_addr once the device is known to be present, as
ixgbe_resume() does. igc has the same problem and gets the same fix.
A similar change was discussed for igb in 2016, when a register read
during suspend triggered the detach, and was not merged because that
read was the real bug. Here the failure happens while the device is
running and powered, so there is no stray access to fix; the device
needs a path back once it is reachable again.
Written with the help of an AI coding assistant (Claude Opus 5.5),
which drafted the patch and this message. Compile-tested only.
Fixes: 22a8b2915998 ("igb: add register rd/wr for surprise removal")
Signed-off-by: François-Xavier Gsell <fxgs…@gmail.com>
---
drivers/net/ethernet/intel/igb/igb_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 131df3e09ba1..3667a86df248 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -9607,6 +9607,10 @@ static int __igb_resume(struct device *dev, bool rpm)
if (!pci_device_is_present(pdev))
return -ENODEV;
+
+ /* A failed register read may have cleared hw_addr. */
+ hw->hw_addr = adapter->io_addr;
+
err = pci_enable_device_mem(pdev);
if (err) {
dev_err(&pdev->dev,
--
2.56.1