Article View: linux.kernel.netdev
Article #25542[PATCH net v7 7/7] igb: only allow runtime PM if the device can wake up
From: Antonio Quartulli
Date: Wed, 02 Dec 2026 00:23
Date: Wed, 02 Dec 2026 00:23
90 lines
13116 bytes
13116 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>
---
v7: mention the wake-up condition in two comments (Sashiko)
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 | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index d7a4b41..6c29152 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5642,6 +5642,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,
@@ -5794,8 +5803,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) &&
@@ -9594,7 +9602,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
* suspend, and an RTNL holder resuming it meanwhile (e.g. ethtool)
* waits for the suspend to end: waiting for RTNL here would deadlock.
* Only try to take it: -EBUSY keeps the device active, and
- * igb_rpm_retry_task() schedules a new suspend.
+ * igb_rpm_retry_task() schedules a new suspend if it can still wake up.
*/
if (!runtime) {
rtnl_lock();
@@ -9764,13 +9772,13 @@ 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;
}
/* Resuming and releasing the device runs igb_runtime_idle(), which schedules
- * a new suspend if the link is still down
+ * a new suspend if the link is still down and the device can wake up
*/
static void igb_rpm_retry_task(struct work_struct *work)
{
--
2.56.1
Technical Details
Message-ID:
<20261202002317.3140591-8-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375456-linux-kernel-netdev=dewy.ruReferences:
<20261202002317.3140591-1-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-375456-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: [PATCH net v7 7/7] igb: only allow runtime PM if the device can wake up Date: Wed, 2 Dec 2026 01:23:15 +0100 Organization: Usenet Network Message-ID: <20261202002317.3140591-8-antonio@mandelbit.com> References: <20261202002317.3140591-1-antonio@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="1850975"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:CYFoFxnfG0ywFW4iF0n01oMieGo= sha256:F9TM2q11MMGFidJ+3EwLQdNtep4PBpmY0nE6SEFQqws= sha1:Q3R+LgADSwh2ZN51QBv5o7QTMes= sha256:CTZuaKHBIXnNMOd9rhPJn2g/p8ALggWLu+mY+0BnOvE= 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 74030117500; Wed, 2 Dec 2026 03:24:04 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, 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, URIBL_BLOCKED=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 rfYJCQ9oahgV; Wed, 2 Dec 2026 03:24:01 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-375456-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 tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id D6C181174F9; Wed, 2 Dec 2026 03:23:52 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id A2DB12AD51; Wed, 2 Dec 2026 00:23:48 +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=1796171015; b=EgHv7EkbJIP0fwIMYixcPiJ1tIodXu7GgjitlhaJxuBnyz94v7YK0ZxFySYZo0Or8Umy iX7cH5dl83Y9zgjeWPGkU6NfRdLuT6ZMnpbiE4dyI6fOF9lJqpn9bPtmCAcznMreQtNG1 98G32V1P6HOPqtirnRjMkpMAJBUu07iTHas5JzalyL/08Y8S/IpG4/4XRppb3cZ8mIoIZ /Hj1sDy+izCElru3IdW0i2DIO8GNo7M+7bQpejT5tCgJlNY2Gzig5bxZdNEbzig0K9OwD GISLNnjfD43giB92xaPSE7ONAP1fOACE2hDpXVJX9kRape7Kb/JZhYTf60PctCGZLvA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171015; 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=YaSHoE8jt/2SITm9q9EVPFQBlwFeXQPys2l2BJ6Apr0=; b=kFdYAiIz1z9faEiWectMr5frYWpMAG/ZCa5wI7GW7yQlNKRkK+3UF9gDjE+rRwrHyn90 nsOr1nNrBK7KrtPOUOGPDlEunbcPm82norae0IRlPBCkqk3E5CnVNtfkhBt83mts9jaGW mGonhhP0pKqMDDKeaD7BDtZP0mJsIV7uyy86PYg1O71ICgmo9ax+chTC3B8DYal/xM0vc vl+74HSggXyVUDE+vEJXOjMA50qKDi5rKkm+P5SWS+mcKcWvfpLzVotg3eZC6yDP8rt8X Umqa4jVDsGwe8rp6vMlWxQnBNfd0e/mrYkk1dCQDsZl18YhT+Ua/m8PQoiSd7j/TMfg== 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=D8bjBYDY; 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 39DAF606A338; Wed, 2 Dec 2026 00:23:35 +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=D8bjBYDY X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.46 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796171014; b=qp1Q/WfeNAtGS+gQCrM0s6GpuGtOOazKAg+w4vPR9HbLPApaHt5e6F1x0IHtdhpkBBn1 qxPqT0Z10Sqnwam2Zav9YXNVCp6GV7HL3bXG9SBkVmSDOhKEBGS93mrh80LuNrLYFRPU1 K/chUsacbIjc2Y9nukoL/mzj9CTaQrm7U9ign5uPJq6hWMY8RmTaw1wJ9fRZfBJRU93Cr GxaarOd49zcfqIvEnWVWKoYnrr52UB4Q7bMyPQ60V1qjID0zIAnAZApUSUnBNVbo5OABX oGfLAJzwEGjDXNqWM76+CGHV5ffqNZXDM2oFD74mfx3ec6LW93LVZmQgWcfGQuuYUdw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796171014; 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=YaSHoE8jt/2SITm9q9EVPFQBlwFeXQPys2l2BJ6Apr0=; b=ZiiMOm7Am8GDphtmC9Wx54fPqNIJV6vdqNt9YE5vkGcjVFZnJIchvKuxritFD1UGBeqv Yawz9oCTsXJsbH6IfGUotOqCYmEheHz/GxsAg4OsI1jmmOBLMQam8eEMrWoLOwiOFLEt9 mQ1+XgwoAIjsdaNLos/fLiQQsKdORQZRk3CdqGLtJI9Pw5azm73xIjhQZGOvUOaHiuRRW i64QXXUTSvyqjNkn7+N0yFKgAPI3kdV3wZ8xx08pY6QSGKxfgwZUo7DoXGL6VNTadcRO3 eRgb6Fd1bn8zonCk9xko62+UJngYOIr4PnsCuoyCdvDZuP8SGCVWfqTF16u+FATPg/w== 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=D8bjBYDY; arc=none smtp.remote-ip=195.10.208.46 X-Received: from mout-b-106.mailbox.org (mout-b-106.mailbox.org [195.10.208.46]) (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 A0DA7606A6B9; Wed, 2 Dec 2026 00:23:33 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A0DA7606A6B9 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 smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (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-106.mailbox.org (Postfix) with ESMTPS id 4jfJQ95BRhzNkH6; Wed, 02 Dec 2026 01:23:29 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796171009; 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=YaSHoE8jt/2SITm9q9EVPFQBlwFeXQPys2l2BJ6Apr0=; b=D8bjBYDYN5qmZXOIbroBrwMVZRHP+8Qkl8NAjNwySSyoh/FBjQllzVDwl2DSY4tetnZ1Kp oOLw6GesjeEaC9IsKhzwfejZqJF6Fp6kmRdryb0WluJ0h8dBZvEU570iMq9TlZcAmU0vVC voQr+WpVCgyo99Q4mqWxPiQVVRbxsSE2L1FTxWKy0VaWUpHoQF0ijV/wEToadzumtumNlV bHOfpX4neH+IGRXftFFQMjhPx1twT3oJksQ18jyiPtVCzsPhAx8If4dc65uFN8S87FcuUe GK8vhXClrslF/SnRMyNeaoUoxVmjNUmnY3/VMn9r5V6T4F4AXZCuQyIZwKKPBA== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::1 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: <20261202002317.3140591-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: 4jfJQ95BRhzNkH6