From: "François-Xavier Gsell" <fxgsell@gmail.com>
To: intel-wired-lan@lists.osuosl.org,
Tony Nguyen <anthony.l.nguyen@intel.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>
Cc: netdev@vger.kernel.org, "Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@kernel.org>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"François-Xavier Gsell" <fxgsell@gmail.com>
Subject: [PATCH iwl-net 1/2] igc: restore hw_addr on resume after a failed register read
Date: Sat, 5 Dec 2026 19:37:09 +0800 [thread overview]
Message-ID: <20261205113710.1833153-2-fxgsell@gmail.com> (raw)
In-Reply-To: <20261205113710.1833153-1-fxgsell@gmail.com>
When igc_rd32() reads all-ones from a register it assumes the PCIe link
is gone, sets hw->hw_addr to NULL and detaches the netdev. From then on
rd32() returns ~0 and wr32() is a no-op. Only igc_io_slot_reset() puts
hw_addr back, so recovery depends on AER reporting the error.
__igc_resume() restores PCI config space, resets the MAC and calls
netif_device_attach(), but leaves hw_addr NULL. After a suspend/resume
cycle the interface is attached again while every register read still
returns all-ones. The driver then reports a link derived from the bogus
STATUS and CTRL values and runs into a Tx hang:
eno1: PCIe link lost, device now detached
igc: Failed to read reg 0xc030!
... suspend / resume ...
eno1: NIC Link is Up 2500 Mbps Full Duplex, Flow Control: RX/TX
eno1: NIC Link is Down
eno1: CTRL ffffffff
eno1: STATUS ffffffff
eno1: Reset adapter
The WARN shows pci_device_is_present() was true when the read failed, so
the device was still on the bus. The only way out is to remove and
rescan the device.
Restore hw_addr once the device is known to be present, as ixgbe_resume()
already does. If the device is really gone, the next register read
detaches it again.
Seen on an I225-V (rev 03) behind an AMD 600 series chipset switch, which
loses MMIO access roughly once a week without any AER report.
Written with the help of an AI coding assistant (Claude Opus 5.5),
which found the bug and drafted the patch and this message; reproduced
and tested on the hardware by me.
Fixes: 9513d2a5dc7f ("igc: Add legacy power management support")
Signed-off-by: François-Xavier Gsell <fxgsell@gmail.com>
---
drivers/net/ethernet/intel/igc/igc_main.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 1fb5f3cbe93c..3dd2ee9a9011 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -7549,6 +7549,10 @@ static int __igc_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) {
netdev_err(netdev, "Cannot enable PCI device from suspend\n");
--
2.56.1
next prev parent reply other threads:[~2026-12-05 11:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 11:37 [PATCH iwl-net 0/2] igc/igb: recover register access on resume François-Xavier Gsell
2026-12-05 11:37 ` François-Xavier Gsell [this message]
2026-12-05 11:37 ` [PATCH iwl-net 2/2] igb: restore hw_addr on resume after a failed register read François-Xavier Gsell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261205113710.1833153-2-fxgsell@gmail.com \
--to=fxgsell@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox