🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #27352

[PATCH iwl-net 1/2] igc: restore hw_addr on resume after a failed register read

#27352
From: François-Xavier Gsell
Date: Sat, 05 Dec 2026 11:37
59 lines
12995 bytes
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
Technical Details
Message-ID: <20261205113710.1833153-2-fxgsell@gmail.com>
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377956-linux-kernel-netdev=dewy.ru
References: <20261205113710.1833153-1-fxgsell@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377956-linux-kernel-netdev=dewy.ru
From: fxgsell@gmail.com (François-Xavier Gsell)
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <20261205113710.1833153-2-fxgsell@gmail.com>
References: <20261205113710.1833153-1-fxgsell@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="3016728"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:MiPG8m/vyyus7Y28fwU/3RPS/S8= sha256:FX9hNqDh4Cz/hoi1+SR4svgEwaMb+jImiSQzaEOtpww= sha1:bqsOP4SvkZ8r08Djhej78U5aPvs= sha256:mY8w2lSQfkKbgSIJIXMltLZ2az2yAdYhI4hwTX1h6cg=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 1011D117DFD; Sat,  5 Dec 2026 14:37:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.297
X-Spam-Status: No, score=-3.297 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rl8EsPkDd3mY; Sat,  5 Dec 2026 14:37:50 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377956-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2A1B4117DF4; Sat,  5 Dec 2026 14:37:41 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 59EDA3498D; Sat,  5 Dec 2026 11:37:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796470659; b=E/5DtUol6eK25SxCvy1x2FN6v9WhDPJEH4t1tMjT7bk8/tcBv71Wc0B75iayn8fsNG3g Zkvxj/px+rFF3Eyymr7AfyTYNPv0dA0RZ4CkqRzowxIpU2eVFIfawY2KKPJsUzshBVnZ1 q9cPtqevCkcLBacwLwTLlspYPa4i66DDW0aQxBRQnO94wGEjqeWGlOJaEUstK8E790ofG F8AUU8f7e0aMu91KKmbVGFSIXIPZArllt/Rviy7RLw+YAUVlLNeC3yrUJGF/USJBIjFv5 VcYZM08dkdJx60Y2wr1os1SUWEqrptmqLrDOx6s7lST4Kg4JvRfKkTMbozebgNI2QdQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796470659; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received: Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Content-Transfer-Encoding; bh=63zdS8ZWaGLW9Vn6WGLFBxlqZS/QEY+ewqhNEFrTaTs=; b=W2tqBK3EGKfKyIVRoztjsf72LW5Kx8KZerF1x5c0UqdNRcptd/zXzqrerG50LG0Tzm8R mUP4Xw70LTVmFAkLSutDJ4Y4thaSX7MO07rU3iFuBJccEfD6R7gbcFIe2oOfmz/O/NJQo /TcGoZ8Ps/ZwpYKDp6lDqV3q8MTdTYvTauj4X1CCwSKutONgZc/RbtdPktl7WTqE9VK0T O+MLvaGh8OrW2A4+HEMCzeZjhhuQXHpmbYaUblYyPqqtVFDgDUEXBb9czrzZW0747+F9i 2g0k6bZXGGahiAbubVs5i1VTReN6UkhsBM4VzLMmF3xG6Efm8HKyg8pDgnvCiWrAn3A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bGN3KoMf; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 290BF606A333; Sat,  5 Dec 2026 11:37:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bGN3KoMf
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.179
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796470658; b=T8kO55GByjOQbt2K43g0daR70wAnMOt6aRnGmBeC9SZnDNgr5KXyRV9fgPY+qZ4gT3RA NjQqL1hjeNFrDrYH9A9iDvi0ZQbp3g2yt2p2nPgPO8piD5XhNfPQY0n0mCTYQQwZVt+Dm c7goy/nuBa/bf6cDkUPXr53PM10dWvgwkfO4l/mc5a9zEOoMPbtuNdEy8/i4B8t0aHDF7 sIZLRiPlFt3Q0SoxjjJx0rVV6kDFD0Y4K5cMumXqP76SQZ+AQo+7KAfKuY//4CWjdjKRP Wznd0FpfYQgTmErRPGdxJ8Wr5r0aA0hfbbT0VB+6VF8BOi6QYdQ6InjNGcwSc1AQSGg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796470658; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=63zdS8ZWaGLW9Vn6WGLFBxlqZS/QEY+ewqhNEFrTaTs=; b=AxOcT5JC6DVoEK9+h0B91I+MU+A2YRDwu5doh0fgJ8xiEhIUD7gtBH+fRoCZGznkb4VR jkLiGQ546RyVcxB5tbddRwDdUq8cQ1FNp4BW9+3NsQaf75Zwezv+ld9oC/oQlvShZnB54 vO0YC5HlVeCsD0qcShvnwsccaZtPmNdr73Nr6YhFwNDgwS4KXj34qwIZbqY+v52DOCmlC iodLNO0xAPyFqWiIvoDezwZWNfVD/a5puKyTBIB0D7J8K8jvMqDruzgC9JRicH7+XOjkA 64guMfUcD2kcg6Vi9Ru8x1FUoTAc7B53ulIaIIk8D/UvKIPlmhPOSyuNMu/Bs+pfzKQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=bGN3KoMf; arc=none smtp.remote-ip=74.125.82.179
X-Received: from mail-dy1-f179.google.com (mail-dy1-f179.google.com [74.125.82.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF708606A322 for <netdev@vger.kernel.org>; Sat,  5 Dec 2026 11:37:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EF708606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f179.google.com with SMTP id 5a478bee46e88-386ab9ab619so2948448eec.1 for <netdev@vger.kernel.org>; Sat, 05 Dec 2026 03:37:37 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796470657; x=1797075457; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=63zdS8ZWaGLW9Vn6WGLFBxlqZS/QEY+ewqhNEFrTaTs=; b=bGN3KoMfM4wJse3rTKxFXYL3MwQrpBYvlaco8XqwlCUM4LPDf8+0i9t6dB/KXv23wD B/h2u9yAIMi5bIHg6LPdzieW2piNLMJG7Cf1n72nykAOPyeUxpToobW1WzVeFBu0JMTc kR5Q46IBccS24sQC0CphRIscvSaA6UdtPgKd4ytUYbnIIZQR3uclKBY7OB4GAOHbMyZw NC9DZ/slECpLJLWU6m3LA1Oya80ieaujujx5q3m8ZOBAWhJ2k8ErkeprbGB6PZNyI9Uk pkm/KUpUP5HoMSCe9DvJAxnhMXDnnbeT+Yy3YEl1O6M0A3XZUkypiFwfZ16wk9W7j5Eh CPTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796470657; x=1797075457; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=63zdS8ZWaGLW9Vn6WGLFBxlqZS/QEY+ewqhNEFrTaTs=; b=eXDDlaX6a2d5K3ML+gsXHUlHd6spA1ibfEXgtr5CJAAxC18dRXcfse4Dr4CJ7cQlxB Hh7qYiOmPV8rBpYFoi9xcRAaqNkjr1QWXlw9jwTPm+Om/EDAFz5b4NP1ghR+AFCSsUGT qBbC79C+p6Vv1D3kBscD32xgZUA6LnjHqaSiIyCeEZFq0b/QDiNEzJMA91ph40KmOju5 Gld9NNjEBrHhUcobY+U8j9uV7TA/wOFvW/OPQwDIW8EsVxJZ5BDHAafiXyReiqYwXroO KR4TW7pZuV/7CqkeFv+G15rbThFjN1/91UyDUZu099NpsFnHpuX3RXWv1fvZNmzrAKvO fLWA==
X-Gm-Message-State: AB4q+uGrIbK7uZYkiXMeVA6vh7ebRbvk3INHI6GtZ+Zt8Tkbo/D4PJ9x jw+CGJYl7dKNu7UK+68T0JSv10CBBqx2edk3afGlLRRal49WyecJyavF
X-Gm-Gg: AZFdTZdnlwIgX63EwiO65lSluSOPCd/vCC+mWrddSOB8iHk6kj9MBlZ0oc/Btrayg/8 QZjN4iTqT9QZmh1LWqBl5U/5zucbj43vIQMCVzUeQGCx8951v6o6FzHiEARBC/ecBvniP3NSflm aSSeaY4S0U8wYsYmVQwonXV4dZVHr0GM7wMjh1H6gVGXqzNotKVHchK62vAQ4YVnGEU9v8J//5V 3exnaPffIyUzhVmb1Iv0pwpVunl/sAGne4FOKWjwICGIXPTayO6Z6GdD28X1i9UTwwcvc4Wf1AS nbSbWiBD20wSbV8lbn+qcC+04j8cVMoXu73pU7QsIPM2w6f8GzySucZX0XfcuuUz5aY9ypARBsN LqMWtE8UwFFOvYxOGLU32QE6GG+tF6qSRlvbnQEIJVQtVfFGwgP0dvX9fr8TuSKhc7tmlUkHf6Q Agd6nLoJYv4UjVvL53Niv5dra5NZNyW4Tacmy9J40W4woSw731FFeLiQ88NaUga6Ee305BFH8nk Iw7h9IcoypBqVVCLeeEOOY9QckLQORY1STOqfz2mf9CDF4GBG9Qk0SFr1wLuEZIvIFFx7VOGlie ff3Km+rzXxKSoZCwos7Qq+gxSYnWO5/f87YBIXDFYdcqN5mzOPcndM4lBTu4xgFRcgqf1oPKV8k =
X-Received: by 2002:a05:7301:a05:b0:387:46bb:75f6 with SMTP id 5a478bee46e88-38752129223mr4615971eec.25.1796470657021; Sat, 05 Dec 2026 03:37:37 -0800 (PST)
X-Received: from magnetar.tailcd130b.ts.net ([103.11.48.23]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3875224312fsm18567758eec.26.2026.12.05.03.37.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 03:37:36 -0800 (PST)
X-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>
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <20261205113710.1833153-1-fxgsell@gmail.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Received-Bytes: 12798