Re: [PATCH net v7 1/7] igb: don't wait for RTNL when runtime suspending

From: netdev-bot+sashiko

Date: Wed Dec 02 2026 - 20:04:29 EST


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