From: netdev-bot+sashiko@kernel.org
To: antonio@mandelbit.com
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
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 [thread overview]
Message-ID: <179625984756.3146.12429470298021311101@kernel.org> (raw)
In-Reply-To: <20261202002317.3140591-2-antonio@mandelbit.com>
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
next prev parent reply other threads:[~2026-12-03 1:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 0:23 [PATCH net v7 0/7] igb: fix runtime PM resume issues Antonio Quartulli
2026-12-02 0:23 ` [PATCH net v7 1/7] igb: don't wait for RTNL when runtime suspending Antonio Quartulli
2026-12-03 1:04 ` netdev-bot+sashiko [this message]
2026-12-02 0:23 ` [PATCH net v7 2/7] igb: don't touch rings that don't exist when disabling an XSK pool Antonio Quartulli
2026-12-03 1:04 ` netdev-bot+sashiko
2026-12-02 0:23 ` [PATCH net v7 3/7] igb: fix RTNL assertion when resuming from runtime suspend Antonio Quartulli
2026-12-03 1:04 ` netdev-bot+sashiko
2026-12-02 0:23 ` [PATCH net v7 4/7] igb: keep the stack's Rx queues that still have an XSK pool Antonio Quartulli
2026-12-03 1:04 ` netdev-bot+sashiko
2026-12-02 0:23 ` [PATCH net v7 5/7] igb: link queues to NAPIs under RTNL after runtime resume Antonio Quartulli
2026-12-02 0:23 ` [PATCH net v7 6/7] igb: resume the device before changing XDP or XSK settings Antonio Quartulli
2026-12-03 0:23 ` sashiko-bot
2026-12-03 1:04 ` netdev-bot+sashiko
2026-12-02 0:23 ` [PATCH net v7 7/7] igb: only allow runtime PM if the device can wake up Antonio Quartulli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179625984756.3146.12429470298021311101@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=antonio@mandelbit.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=hawk@kernel.org \
--cc=hkallweit1@gmail.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=janislacis06@gmail.com \
--cc=joe@dama.to \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=kurt@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.com \
--cc=rafael@kernel.org \
--cc=sdf@fomichev.me \
--cc=sriram.yagnaraman@ericsson.com \
--cc=stable@vger.kernel.org \
--cc=sven.auhagen@voleatech.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox