🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24796

[PATCH net v6 7/7] igb: only allow runtime PM if the device can wake up

#24796
From: Antonio Quartulli
Date: Mon, 30 Nov 2026 21:37
73 lines
12277 bytes
igb lets the device be runtime suspended even if it can't signal a
wake-up from D3. Such a device doesn't notice the link coming back, so
the port stays down until it is resumed from user space.

Only schedule a runtime suspend if pci_dev_run_wake() is true. Devices
that can't wake up no longer runtime suspend, even with power/control
set to auto. Checking it when scheduling the suspend, rather than at
probe and remove as e1000e and r8169 do, keeps the runtime PM usage
count balanced if the result changes while the driver is bound.

Tested with the 82576 emulated by QEMU.

Fixes: 749ab2cd1270 ("igb: add basic runtime PM support")
Cc: stable@vger.kernel.org
Closes: https://bugzilla.ipfire.org/show_bug.cgi?id=13562
Reviewed-by: Janis Edvarts Lacis <janislacis06@gmail.com>
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
v6: no changes
v5: check pci_dev_run_wake() when scheduling the suspend rather than
at probe and remove, which keeps the usage count balanced (Sashiko)
v4: no changes
v3: no changes
v2: no code changes; mention the tested hardware

Note: igc has the same issue: igc_probe() also allows runtime PM
regardless of pci_dev_run_wake().

 drivers/net/ethernet/intel/igb/igb_main.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e5a2870..d8f8df8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5643,6 +5643,15 @@ static void igb_watchdog(struct timer_list *t)
 	schedule_work(&adapter->watchdog_task);
 }
 
+/* A device that can't wake up wouldn't notice the link coming back while
+ * runtime suspended
+ */
+static void igb_schedule_runtime_suspend(struct igb_adapter *adapter)
+{
+	if (pci_dev_run_wake(adapter->pdev))
+		pm_schedule_suspend(&adapter->pdev->dev, MSEC_PER_SEC * 5);
+}
+
 static void igb_watchdog_task(struct work_struct *work)
 {
 	struct igb_adapter *adapter = container_of(work,
@@ -5795,8 +5804,7 @@ no_wait:
 					return;
 				}
 			}
-			pm_schedule_suspend(netdev->dev.parent,
-					    MSEC_PER_SEC * 5);
+			igb_schedule_runtime_suspend(adapter);
 
 		/* also check for alternate media here */
 		} else if (!netif_carrier_ok(netdev) &&
@@ -9765,7 +9773,7 @@ static int igb_runtime_idle(struct device *dev)
 	struct igb_adapter *adapter = netdev_priv(netdev);
 
 	if (!igb_has_link(adapter))
-		pm_schedule_suspend(dev, MSEC_PER_SEC * 5);
+		igb_schedule_runtime_suspend(adapter);
 
 	return -EBUSY;
 }
-- 
2.56.1
Technical Details
Message-ID: <20261130213740.3323814-8-antonio@mandelbit.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374473-linux-kernel-netdev=dewy.ru
References: <20261130213740.3323814-1-antonio@mandelbit.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374473-linux-kernel-netdev=dewy.ru
From: antonio@mandelbit.com (Antonio Quartulli)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v6 7/7] igb: only allow runtime PM if the device can wake up
Date: Mon, 30 Nov 2026 22:37:37 +0100
Organization: Usenet Network
Message-ID: <20261130213740.3323814-8-antonio@mandelbit.com>
References: <20261130213740.3323814-1-antonio@mandelbit.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="1544189"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Yu0bhB12VUfrDWOmHNhpLsU589o= sha256:rn6abLHv+tGhdFbKVqrWhMzfZfiLRBPWcDPO2caSN34=
	sha1:Gq3KW9/fVya+j4gjYDJEeJLsDkI= sha256:4N+U5jttDe4h1Gxc22H+5I+zmhz0CTfvwFQZaztrmBA=
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 DB0FD12600E; Tue,  1 Dec 2026 00:38:46 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.151
X-Spam-Status: No, score=-3.151 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=mandelbit.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 h6XcU8Y50grx;
	Tue,  1 Dec 2026 00:38:43 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-374473-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Received: from sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id AE18D12600C; Tue,  1 Dec 2026 00:38:32 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sto.lore.kernel.org (Postfix) with ESMTP id 48ECF601E9A; Mon, 30 Nov 2026 21:38:31 +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=1796074695;
	b=AT0cq/4EgcSRZLqWI/epObjCtNq2TAyciIFA7rfxnKfrfzeKegldr01233BZA9Kah2Uo
	 qsczLKAq+CXFHGNpP0Zl5a5q1ydYx9s9FOV+caEIK3qDOBslZRJnzEcLVdNwRzJz/ya5Z
	 yYaNY8G0ifiggR6LunCCJFfcnXpjEhJwjP2L8bjZdCY647iO1oFHAl5RvsCm+JXYXDohv
	 o3kg+1CYmYnMPdCl4kAexSQQmKq28LZUjdP+gCv6og2Mx+FI3MayiwrPKUTyXoEw7t9aL
	 AG9qmQFObrPCI7hesvkaIoZ4ySCg67PIggv9o+k8Rmvr9mBMfGeThfFXkpAsWl1EIZg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796074695;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: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-Transfer-Encoding:X-Rspamd-Queue-Id;
	bh=KucF5ZJesoexbrITKCJ8H1GPhn03LwESX7ufK1gNbug=;
	b=3+b1/wxT9a1J9wWr9OEgPNGNni3QD+Z+XK3wn72WKYl9+g95KBeKVy5UI/0Ln04hNxId
	 BhwVv8RmvTWfYNY5FS0Bq29uEeMQq7dPWLzjduDyhFlsCxwUCV+Fq1IMEI8kTgum9xHl6
	 ReeNEvmbZGH0gtd4Bw5IaFHnYclUV9wbx9UxpZ7EBG56WhwgaynJdM7cZBtBYzzoI6WXQ
	 B3kEchsh3hsngEk2uFB+ADS4O7HOtrSr8BwAE9YLxpkXv2ruM/LBRHHMT9DIp1zBLkqYu
	 MGotGq9m8Cpe7qiCMkHZAM3G1TvcjQq+jTKglTUlWfKyYX5LCDM54lUZ48lT7UIsQwQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=pE03yqnK;
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.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 81DF0606A33C;
	Mon, 30 Nov 2026 21:38:15 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=pE03yqnK
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.50
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796074684;
	b=vryPkYHH5rLT1c+vDC8wzH11VMwZ9ZCjj3eJ6N6r0umA2DVeeUY+Ro4HE7ul5TPxRwzl
	 ZFI2VHP988kM7z9cKXe1D9Ti6HLVtPlhgRvs4eCouJbGrwRsiYwXIcuynf7PwTAoGkq0E
	 jqHxv2Hsh6dp76m0gakhsunsQs2Wk2Mk7tgvJd4zFckOBvza4HTkKTDF4ZR6lWNJmgWTe
	 J/X7jri09nXRrN49rFV8YV6NXQziswPZZ6DQMH8gh967iZjzj+7N6rz4TxAfVmaDCcP3q
	 Ud7ViyZAHZHP2tiwIsWNsfXu24Vp/beNpbp3n+uEKV7DCgGpMrSb741sB45SvfK/FJQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796074684;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Queue-Id;
	bh=KucF5ZJesoexbrITKCJ8H1GPhn03LwESX7ufK1gNbug=;
	b=T+SGO0KNEuvYcKwsjkoypYYQ2D4AAonGS7kbWdBsTgMhOFjHrNHZ/Z6LPeMwTxciirz6
	 ujbtMwJPySihOZwWMMA/pwOAt6hVyR4dzu0Scm76Dk44NDn1jrIAWvyQMNlrP/VvPwRSm
	 8ujCFH8aFbFo0iyX8CpeoxggmShRqlEPahVjHbmfhD0QohxP8ifJVaIKU1xh+6zl/blrR
	 d+4UYuP8UG7nucKhgDL/n/VNwv4LGxj2NzhilfGyfCVS+Nu01XIgOBoDevVuswhn/xEZw
	 j5TR2NC1vpJsd04lpwcloArs67gSHCgPykJJJPppmBnSsE9NDYQIWXyi41ZI9Dfencg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=pE03yqnK;
	arc=none smtp.remote-ip=195.10.208.50
X-Received: from mout-b-105.mailbox.org (mout-b-105.mailbox.org [195.10.208.50])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28B2960A2609;
	Mon, 30 Nov 2026 21:38:03 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 28B2960A2609
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com
X-Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mout-b-105.mailbox.org (Postfix) with ESMTPS id 4jdcnh1PmFz9t2s;
	Mon, 30 Nov 2026 22:38:00 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
	s=MBO0001; t=1796074680;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=KucF5ZJesoexbrITKCJ8H1GPhn03LwESX7ufK1gNbug=;
	b=pE03yqnKabkv1UkhGgqWRs0TwhxIhOn1qDTvgN8LCWI8m7mrXfuLkFCe4ySzf8lnHNnY5y
	Kc33bhviZixiiiAw5jwYpnZVvkkgGYpqMIzsWhGywArLZK1wU2MK/CGFHBor6FVIKsICSM
	joNbCckb3bE3aSs0H/vywoqrjV4H4QGYMbkVDXkEMDJaG087W8KPYcD5feq3It7+oilgpW
	6HiK43YZdMEYLGVLgIv8CPoUU3jQs6ThUBQu0qSSvcjEEoE1BGA/0zdBw1eRKmgUr8ImaJ
	7S20PunS1S7OFR9n7pDo1QH9tLctga2LZyzSbyUkqMOBZ36Ss4MtLvUSIi1edw==
X-Authentication-Results: outgoing_mbo_mout;
	dkim=none;
	spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::202 as permitted sender) smtp.mailfrom=antonio@mandelbit.com
X-Cc: Antonio Quartulli <antonio@mandelbit.com>,
	Tony Nguyen <anthony.l.nguyen@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>,
	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>,
	Janis Edvarts Lacis <janislacis06@gmail.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	John Fastabend <john.fastabend@gmail.com>,
	Stanislav Fomichev <sdf@fomichev.me>,
	Sriram Yagnaraman <sriram.yagnaraman@ericsson.com>,
	Kurt Kanzenbach <kurt@linutronix.de>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Joe Damato <joe@dama.to>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Sven Auhagen <sven.auhagen@voleatech.de>,
	netdev@vger.kernel.org,
	linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org,
	stable@vger.kernel.org
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <20261130213740.3323814-1-antonio@mandelbit.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-Rspamd-Queue-Id: 4jdcnh1PmFz9t2s