[PATCH net v5 6/6] igb: only allow runtime PM if the device can wake up

From: Antonio Quartulli

Date: Tue Nov 24 2026 - 18:58:00 EST


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@xxxxxxxxxxxxxxx
Closes: https://bugzilla.ipfire.org/show_bug.cgi?id=13562
Signed-off-by: Antonio Quartulli <antonio@xxxxxxxxxxxxx>
---
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