Article View: linux.kernel.netdev
Article #26078Re: [PATCH net v7 1/7] igb: don't wait for RTNL when runtime suspending
From: netdev-bot+sashiko
Date: Thu, 03 Dec 2026 01:04
Date: Thu, 03 Dec 2026 01:04
136 lines
12967 bytes
12967 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] The new member `struct work_struct rpm_retry_task` goes into the
middle of `struct igb_adapter`β¦
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but the igc driver
(I225/I226) still has the same RTNL vs. RPM_SUSPENDING deadlock thatβ¦
--
igb: don't wait for RTNL when runtime suspending
This patch changes __igb_shutdown() to use rtnl_trylock() on the runtime
suspend path. If RTNL is contended, it returns -EBUSY to avoid a deadlock
with RTNL holders that resume the device. A new work item,
igb_rpm_retry_task(), resumes and releases the device so that
igb_runtime_idle() can schedule another suspend.
> diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
> index 8c9b02058cecb..4250b4d363ea3 100644
> --- a/drivers/net/ethernet/intel/igb/igb.h
> +++ b/drivers/net/ethernet/intel/igb/igb.h
> @@ -586,6 +586,7 @@ struct igb_adapter {
>
> struct work_struct reset_task;
> struct work_struct watchdog_task;
> + struct work_struct rpm_retry_task;
[Severity: Low]
This isn't a bug, but struct igb_adapter has this comment further down:
/* to not mess up cache alignment, always add to the bottom */
Placing a work_struct here moves fc_autoneg, blink_timer, pdev,
stats64_lock, stats64, hw, stats, q_vector[] and the other later members
to new offsets.
rpm_retry_task is only used on a failed runtime suspend and in
igb_remove(). Could it go below that comment instead? If the comment no
longer applies, it could be updated or removed.
The later patch in this series, "igb: fix RTNL assertion when resuming
from runtime suspend", adds rtnl_resume_task in the same place, so the
same question applies there.
> bool fc_autoneg;
> u8 tx_timeout_factor;
> struct timer_list blink_timer;
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index 131df3e09ba14..2fb9615d3bab3 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
[ ... ]
> @@ -9500,7 +9503,18 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake,
> u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
> bool wake;
>
> - rtnl_lock();
> + /* The PM core marks the device as suspending before a runtime
> + * 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.
> + */
> + if (!runtime) {
> + rtnl_lock();
> + } else if (!rtnl_trylock()) {
> + schedule_work(&adapter->rpm_retry_task);
> + return -EBUSY;
> + }
[Severity: High]
This is a pre-existing issue in a sibling driver, not something
introduced by this patch. Does igc have the same RTNL vs RPM_SUSPENDING
deadlock that this patch fixes in igb?
igc_runtime_suspend() goes through __igc_shutdown() with runtime=1, and
that path takes RTNL unconditionally:
drivers/net/ethernet/intel/igc/igc_main.c:igc_runtime_suspend() {
return __igc_shutdown(to_pci_dev(dev), NULL, 1);
}
drivers/net/ethernet/intel/igc/igc_main.c:__igc_shutdown() {
...
rtnl_lock();
netif_device_detach(netdev);
...
}
At the same time, RTNL holders resume the device, and rpm_resume() waits
for the suspend in progress to finish:
drivers/net/ethernet/intel/igc/igc_main.c:__igc_open() {
...
if (!resuming)
pm_runtime_get_sync(&pdev->dev);
...
}
drivers/net/ethernet/intel/igc/igc_main.c:__igc_close() {
...
if (!suspending)
pm_runtime_get_sync(&pdev->dev);
...
}
The ethtool ioctl and netlink paths in net/ethtool/ also call
pm_runtime_get_sync(dev->dev.parent) while holding RTNL.
igc_runtime_idle() uses the same pm_schedule_suspend(dev, 5000) scheme
as igb. The trigger looks the same: link down, power/control set to
auto, and an ethtool query or ip link up/down at the moment the delayed
suspend runs. RTNL would then stay held, and later networking
configuration would hang.
This igc code has not changed since 2019, and no patch in this series
touches igc. Would a matching igc fix make sense, either in this series
or as a follow-up, so stable can pick up both?
> netif_device_detach(netdev);
>
> if (netif_running(netdev))
[ ... ]
--
Sashiko AI review Β· https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261202002317.3140591-1-antonio%40mandelbit.com
Technical Details
Message-ID:
<179625984756.3146.12429470298021311101@kernel.org>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376185-linux-kernel-netdev=dewy.ruReferences:
<20261202002317.3140591-2-antonio@mandelbit.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu.MISMATCH!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376185-linux-kernel-netdev=dewy.ru From: netdev-bot+sashiko@kernel.org Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v7 1/7] igb: don't wait for RTNL when runtime suspending Date: Thu, 03 Dec 2026 01:04:07 +0000 Organization: Usenet Network Message-ID: <179625984756.3146.12429470298021311101@kernel.org> References: <20261202002317.3140591-2-antonio@mandelbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="2101602"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4tv+S3AmI6yvqg+XqiRt0YUUAKw= sha256:YT9SUcMmD2bBNM6bZbUZt6fp6v/FqcRGapQi3jM0Ino= sha1:jAhNBQyWP+uflngr3n1ZKyMlGFA= sha256:fSs1/i4CgGu98JSNtYdWsudm7kkZ/gjYq/HlzwO/o7c= 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 6FD4B1177CB; Thu, 3 Dec 2026 04:04:38 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.501 X-Spam-Status: No, score=-3.501 tagged_above=-9999 required=6.31 tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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=kernel.org 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 tpnZeb2ANQxU; Thu, 3 Dec 2026 04:04:35 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376185-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 20CAD117304; Thu, 3 Dec 2026 04:04:20 +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 AE1DA2806D; Thu, 3 Dec 2026 01:04:16 +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=1796259855; b=owjdQi8pmddxD8NgZC4iFQbTR1Sb6MGY+P2d91CZNEOtSsucv1A5snhj0pgA1D33h8Pb b4u0mZfVxGlKlzyO6YzL22vpUAPQqd9Eif3y5fsdnhr0D1a0XySH0OzkhnVhQg5nLbJ49 jFZoOkV+Jp9FJ+Tjk+65GoNSrvoBF3B0omi63m/V86kelh98jU2Os0sQw1X11w6no8D8J /Xb1M3IHkR8aVJCoDJcmupzO5neaosQljjguUu9DzDuJrCqqSxfcDxN/PaF83oDW44/pg jozjLBdLM3UIv0i1IpJ3kTuVE0/MUdA0ITQ1ct3Cqoczb4dCzp7QlwjA3jmaBorlBOA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796259855; h=X-Original-To:Received:Received:DKIM-Signature:Subject:From:To:Cc: Date:Message-ID:In-Reply-To:References:X-sashiko-severity: Content-Type:Content-Transfer-Encoding:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version; bh=OGP89q9DZgIQkOR3sjSCVQjrNM//6D4BctaarP7ymbQ=; b=NXHcKqyoTMDUU8kC5oVl1fRRP4cQvH7dnHHx+fq6W9475lG0wAdbC82T0OWh6bE19kRF n7KefQQkeky/cnW3ACIzZWous5VUzKUvlCVF1ZsKVyCbm8TsgW0E3ihs/knRHUsHVy9pO QqskUlK9tzY9bDJQdyKYHBhl4EujEhpOv/ogDl9Olz2DDJDg0alUs5uKJW5pvW4HXDu7I UEb+sxQuf5cd/aEDDE/uo2g0AY9tWY+YrCQvEPOcmsnIBw+XapuCMpphxxUZkg8b4m1Vf fzyOmThlA0QVYITxgkec4rH5XU5WaWz1g3p9oadRLgVMsAqacCCKHkmCJwGLZH4uynQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=axl8pcJV; 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 7E8DB606A693; Thu, 3 Dec 2026 01:04:15 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=axl8pcJV X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796259849; b=Qem4kFSozNAry2jZ+bZke8XCCuJsjxe5a5WUqgKj09kSxMwl4zaWrolb4IF8I7nYyOb7 Eyjspn9qRFFfzMXKlxkZDUPpcB5NZLZGM7ngRmOvKTAzlMpSEj1/TzFGMbc6vjJRigl7M aW4FLrulCF2OpshC9ytJf/ULPXOIsmTcflvw050g6+6w8UJE/mfvASIDJf0SeF1+rRHHR /SqimL7Yt4deDedybjWJHdmJej2TWSwkOlAQ8tAfEx+enstTwG3vIwEN0x8Zs9Ge8bjqn 9oCDGTFonR9CpaCX6RqTx2Mui7NtJfeCf1uDfQbfOTI+vSn+A1fYt2VSy32e5x17uQg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796259849; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=OGP89q9DZgIQkOR3sjSCVQjrNM//6D4BctaarP7ymbQ=; b=xQIAS+5RuC/to8DQY5dMp6kkmgEri1YF6rFwBeg/kKDCa7D+bczCUQY+pvzEWzMD3a+A 9rsGSnlfJVqsOZi7g8ngzp26gifMf1eYNJcJJpbMtD3jA02rdlIgmjMyqrEz9/nr3Fcfq ZpP5wzFjgaYS6tRZjIkReA7dzztFa0Y8i9F67iL1JCIbAL5XlcLGR3qvaDAhQrzJ45IJc 8/m+C8COMO30MMsSxzlwH8N+eToijFDVqQVzjOy9K+U5PDF7L+grSiFI49+WKyJNml3r1 ol2EiF3HfTgzaT5Yzj6aMckYffrg7leFtFEvaflfCZ/V7vZssg99Jz9VpF0s66ftF0w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=axl8pcJV; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B52E606A32C; Thu, 3 Dec 2026 01:04:09 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CDCD1F00893; Thu, 3 Dec 2026 01:04:07 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796259849; bh=OGP89q9DZgIQkOR3sjSCVQjrNM//6D4BctaarP7ymbQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=axl8pcJVybPRThW9VlxivnhmvXsCxRUxVLdk/atJUuKpWfj1Z93qrQVOl2dJeDinn SRMW01ftwegUEBfEL+V76Ap5zO35O3zFIQ41ASomi8K6lJK7YhqE1irRDb2qRzV2CG 7smLPjVoTrsqnh407k6MNN2bdhZp5nDmZJsIDQQhRDe8cc3N1yIqXLITyihY3RIn67 MYcvDXZ4++z+c/Vxt2LDJBZLHasg3bGabUshe2IuHNZZnOGds9tzPEVHBKRj1dSDuz uB+h/VM8/ZC4k51IIzzDUVc3SIwv+rrDBhtt/GqmYuyl2rWdsiOYCHmIlD0HpWfBlC zGD+HeyHShS4A== X-Cc: intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, janislacis06@gmail.com, ast@kernel.org, daniel@iogearbox.net, hawk@kernel.org, john.fastabend@gmail.com, sdf@fomichev.me, sriram.yagnaraman@ericsson.com, kurt@linutronix.de, maciej.fijalkowski@intel.com, hkallweit1@gmail.com, joe@dama.to, rafael@kernel.org, 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-In-Reply-To: <20261202002317.3140591-2-antonio@mandelbit.com> X-sashiko-severity: Low 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