Article View: linux.kernel.netdev
Article #22189[PATCH net v5 6/6] igb: only allow runtime PM if the device can wake up
From: Antonio Quartulli
Date: Tue, 24 Nov 2026 23:57
Date: Tue, 24 Nov 2026 23:57
71 lines
11568 bytes
11568 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
Signed-off-by: Antonio Quartulli <antonio@mandelbit.com>
---
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 80ae03d..853bdf4 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5625,6 +5625,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,
@@ -5777,8 +5786,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) &&
@@ -9741,7 +9749,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:
<20261124235723.1135808-7-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370885-linux-kernel-netdev=dewy.ruReferences:
<20261124235723.1135808-1-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370885-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: [PATCH net v5 6/6] igb: only allow runtime PM if the device can wake up Date: Wed, 25 Nov 2026 00:57:21 +0100 Organization: Usenet Network Message-ID: <20261124235723.1135808-7-antonio@mandelbit.com> References: <20261124235723.1135808-1-antonio@mandelbit.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="67687"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:ObQ2VE2UgkQeN7jWnAtfL/9TDkc= sha256:RqZRRhDQ0845jGAG/EzNKhxRKeU5QliOspewaBsWbOQ= sha1:ikDrT5RlG5MhEO76UZpLDVNcvuo= sha256:CXr7EOKtsLDZBoPtPHEBtGVv74o5i0S2eRv9FQbc1dU= 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 4BC71125E2F; Wed, 25 Nov 2026 02:58:09 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 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] 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 XP5jnZ6PbIwF; Wed, 25 Nov 2026 02:58:05 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370885-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 48C0B125E37; Wed, 25 Nov 2026 02:57:57 +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 BB5B33A6BC; Tue, 24 Nov 2026 23:57:46 +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=1795564664; b=c48P1dvWPXX9fPDkl7dYe1OSaQ/4ZlDPVbg75cNVp/JZZ4b8TkJmiwWE12hFwPbxiXBW DH4z5ifZ2+rJ81yU+ytTQcE83MkaJ6F6rfwlIkOYJ6o5GqbAn9Vuqugm01No4pmjsSxQb yQSvwtDeEqqOSLXvr3BLY+h6oEPTFo7b7kbN/b0yW1Zm0c67XoExud8RzQf255kiJf/v0 RnAiQnz+H/y2vkZyoWJa2QLrO89XG5B3UCW0R3bIAidH6YxCXiAjZCDbxup05pYupukpJ yfiZ3I3bLh6iT6aDNH2xPBy6ft2CkIhSZFP4qGxTN0qDZbv5Qqit8Mtl0rURlb6LuIQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795564664; 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=zCpEUkgnC6nNW718VYsVFX4l9kDyJsq5iPDHI4it1XI=; b=2ob+qEgx9TKH5vMU81Ie7O3xusLlS3BwiAhZ+Lba4eH1ho75elXpznt6Xa2YtqbMqf64 KyWjQMkS/zbk5+GkfDjYXxczXq4HwrlBX6ol/F7AeY/cYrZAZd7e+3s20h18xa3jl600t fGT51u/2b/kIr5kT86hI8o3bpTHksBOt921q9hJcz1nauRaUOpWu9bH+MCkkdHvuoAk2K 4ncsRVI/aR6RdL0pjpQ9qzBY/Vq2+mJRPxECLRRy90M1GpbYgTLQ8zRL419EWh1HJG6eM X+1Blt2uIZr2lcGX/L+mLRDIvtDwMv+Iml4jm500jnpNFIM+2efSVygD6195FZmQZRw== 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=RclqWh0z; 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 EA561606A6A5; Tue, 24 Nov 2026 23:57:43 +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=RclqWh0z 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=1795564663; b=sMrHwsD8ckJkw78l2FQMjB/WlRdcg3unm+SHF6X0Q0p/JINO9ybxAMNpqDgB9U1Q1itH GlfR5UMJ2rPC0CiS/rlhoSfdQ8mKeJbFNCWlrwbyRDtpsZchrHfqgOtXUHGQ6CPyItUfT GbQJQi6NEH4I1FwiQpX9svzP09L+K8Snhy+ZbPRU9mkXm6eXKIqxKnXH7d+Z+Ena60pp0 UDlQsXYE+NCssyFvGSl7Nog5QK5/FBBMXRnUDHzsaKlSDb9XIAU7YCxGZNfLE67SkKlGV M7TYBcVbU9Fb0cJ901sgdLs24i+6ypRaM1MmuNJ8d2YPLaz5QD3VpinHdQQWWC9kOgA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795564663; 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=zCpEUkgnC6nNW718VYsVFX4l9kDyJsq5iPDHI4it1XI=; b=P7Sz//3UokFjEFh0kh7edjdt5L/PFjmn7JqikTt6zuYErcLzPtAsgFh+NOAXv34sOCQT 9sbm673LLCV3v8R0PVIahdHq15GZgtQqQyKk6HelhwgM5hhl0Vqy4PZAOzSC+f4O49dId uuNT0p9WgOeO8f0LGb8CTeF0EHxNsDVy88HRZoC892ICvVpsUMc8rUuZOKmgA3D3Z7eVv QmSh2QPLDMJOXdqiWH7R61+iBXtvEE9aO1t3MA/PN3qvnywZKvdB/LCxcpVYaM48xU/3R Q3VQVzGCSl0wmyq8pcJcEDHRnwEgRjlEw4s6cTnyOUeeT5AjxCOdQyEYkWpbasijbTg== 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=RclqWh0z; 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 607C4606A33C; Tue, 24 Nov 2026 23:57:42 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 607C4606A33C 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 smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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 4jZ09Z1pQ0zNmCY; Wed, 25 Nov 2026 00:57:38 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1795564658; 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=zCpEUkgnC6nNW718VYsVFX4l9kDyJsq5iPDHI4it1XI=; b=RclqWh0zW4yQcc6GrRBXcV9uuCLN0ckFv4ZxT0YoXpcuqJlJWSGbIK6KLgk+uYkkNd0UgF xAGL/od2acr9mpURA3z2IXVhAy6Qv0rbpyWqj4dMeMJz1B7nOl9ElXnE7LxuQXxdoUGDgw GqHTIYCt8AaXki0f92mpy388pRppX5Ewg/140NJZbj3/WTrwAYE19ydIUr7i3DLhssX3S/ CPi7ODZNgMYrSkMQuHatkpwUpZ/Iszr5eBtz9Wk11lrEllMWqPuNEMbKSQ0xG1vbMELCyM 2ONQiJAs81XbhUVSLe+mll8JeqgTcnUxciVOMiVVP5pXqIousqqGw+ogm5HjnA== X-Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::102 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>, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org X-Mailer: git-send-email 2.56.1 X-In-Reply-To: <20261124235723.1135808-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: 4jZ09Z1pQ0zNmCY