Skip to contentSkip to conversation

igc: fix netdev not re-attached after resume if interface is down

PATCH In review Philipp David 3 participants 3 messages Jul 17 – Aug 4

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igc: fix netdev not re-attached after resume if interface is down

__igc_resume() calls netif_device_attach() only inside the netif_running() branch, so an interface that was down during suspend is never re-attached on resume. It then stays in the not-present state that __igc_shutdown() set via netif_device_detach(): ethtool reports ENODEV and every attempt to bring the interface up fails the netif_device_present() check in __dev_open() with -ENODEV, silently, since __igc_resume() returns 0. Only reloading the driver recovers the device.

This is easy to hit in practice because NetworkManager brings managed interfaces down before sleep unless Wake-on-LAN is configured, making the adapter unusable after every suspend/resume cycle with WoL disabled.

Re-attach the netdev on every successful resume, as igb and e1000e do.

Fixes 6f31d6b643a3 ("igc: Refactor runtime power management flow")
---
 drivers/net/ethernet/intel/igc/igc_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +5 -3
index 2c9e2dfd8499..e777c2df0b73 100644
@@ -7586,11 +7586,13 @@ static int __igc_resume(struct device *dev, bool rpm)
 		err = __igc_open(netdev, true);
 		if (!rpm)
 			rtnl_unlock();
-		if (!err)
-			netif_device_attach(netdev);
+		if (err)
+			return err;
 	}
 
-	return err;
+	netif_device_attach(netdev);
+
+	return 0;
 }
 
 static int igc_resume(struct device *dev)
Signature · 1 line
2.54.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 61 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Philipp David via Intel-wired-lan
Sent: Friday, July 17, 2026 11:22 AM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Philipp David <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH] igc: fix netdev not re-attached after resume if interface is down

__igc_resume() calls netif_device_attach() only inside the netif_running() branch, so an interface that was down during suspend is never re-attached on resume. It then stays in the not-present state that __igc_shutdown() set via netif_device_detach(): ethtool reports ENODEV and every attempt to bring the interface up fails the netif_device_present() check in __dev_open() with -ENODEV, silently, since __igc_resume() returns 0. Only reloading the driver recovers the device.

This is easy to hit in practice because NetworkManager brings managed interfaces down before sleep unless Wake-on-LAN is configured, making the adapter unusable after every suspend/resume cycle with WoL disabled.

Re-attach the netdev on every successful resume, as igb and e1000e do.

Fixes 6f31d6b643a3 ("igc: Refactor runtime power management flow")
---
 drivers/net/ethernet/intel/igc/igc_main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +5 -3
index 2c9e2dfd8499..e777c2df0b73 100644
@@ -7586,11 +7586,13 @@ static int __igc_resume(struct device *dev,
 bool rpm)
 		err = __igc_open(netdev, true);
 		if (!rpm)
 			rtnl_unlock();
-		if (!err)
-			netif_device_attach(netdev);
+		if (err)
+			return err;
 	}
 
-	return err;
+	netif_device_attach(netdev);
+
+	return 0;
 }
 
Quoted 3 lines

static int igc_resume(struct device *dev)
--
2.54.0

Reviewed-by
#2 lore raw
Quoted 61 lines · Aleksandr
Quoted 61 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Philipp David via Intel-wired-lan
Sent: Friday, July 17, 2026 11:22 AM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S . Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Philipp David <[email protected]>; [email protected]
Subject: [Intel-wired-lan] [PATCH] igc: fix netdev not re-attached after resume if interface is down

__igc_resume() calls netif_device_attach() only inside the netif_running() branch, so an interface that was down during suspend is never re-attached on resume. It then stays in the not-present state that __igc_shutdown() set via netif_device_detach(): ethtool reports ENODEV and every attempt to bring the interface up fails the netif_device_present() check in __dev_open() with -ENODEV, silently, since __igc_resume() returns 0. Only reloading the driver recovers the device.

This is easy to hit in practice because NetworkManager brings managed interfaces down before sleep unless Wake-on-LAN is configured, making the adapter unusable after every suspend/resume cycle with WoL disabled.

Re-attach the netdev on every successful resume, as igb and e1000e do.

Fixes 6f31d6b643a3 ("igc: Refactor runtime power management flow")
---
  drivers/net/ethernet/intel/igc/igc_main.c | 8 +++++---
  1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/igc/igc_main.c +5 -3
index 2c9e2dfd8499..e777c2df0b73 100644
@@ -7586,11 +7586,13 @@ static int __igc_resume(struct device *dev,
 bool rpm)
  		err = __igc_open(netdev, true);
  		if (!rpm)
  			rtnl_unlock();
-		if (!err)
-			netif_device_attach(netdev);
+		if (err)
+			return err;
  	}
 
-	return err;
+	netif_device_attach(netdev);
+
+	return 0;
  }
 
Quoted 5 lines
Quoted 3 lines

static int igc_resume(struct device *dev)
--
2.54.0