Skip to contentSkip to conversation

ice: wait for reset completion in ice_resume()

PATCH Superseded Aaron Ma 5 participants 9 messages Apr 24 – Apr 29

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Aaron Ma

author
#0 lore raw

PATCH v2 1/1 ice: wait for reset completion in ice_resume()

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

ice_resume()
ice_schedule_reset() # sets ICE_PFR_REQ, returns
...
ice_open()
ice_is_reset_in_progress() # ICE_PFR_REQ still set, -EBUSY
...
ice_service_task()
ice_do_reset()
ice_rebuild() # clears ICE_PFR_REQ, too late

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Wait for the reset to complete before returning from ice_resume().

Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

 drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +9 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
 	/* Restart the service task */
 	mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
+	/* Best-effort wait for the scheduled reset to finish so that the
+	 * device is operational before returning. Without this, userspace
+	 * (e.g. NetworkManager) may try to open the net device while the
+	 * asynchronous reset is still in progress, hitting -EBUSY.
+	 */
+	ret = ice_wait_for_reset(pf, 10 * HZ);
+	if (ret)
+		dev_err(dev, "Wait for reset failed during resume: %d\n", ret);
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 74 lines

-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aaron Ma via Intel-wired-lan
Sent: Friday, April 24, 2026 5:04 AM
To: 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]>; [email protected]; linux- [email protected]
Cc: Akeem G Abodunrin <[email protected]>; Jesse Brandeburg <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2] ice: wait for reset completion in ice_resume()

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

ice_resume()
ice_schedule_reset() # sets ICE_PFR_REQ, returns
...
ice_open()
ice_is_reset_in_progress() # ICE_PFR_REQ still set, -EBUSY
...
ice_service_task()
ice_do_reset()
ice_rebuild() # clears ICE_PFR_REQ, too late

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Wait for the reset to complete before returning from ice_resume().

Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

 drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
 	/* Restart the service task */
 	mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf-
 >serv_tmr_period));
 
+	/* Best-effort wait for the scheduled reset to finish so that

the

drivers/net/ethernet/intel/ice/ice_main.c +1 -0
+	 * device is operational before returning. Without this,

userspace

drivers/net/ethernet/intel/ice/ice_main.c +1 -0
+	 * (e.g. NetworkManager) may try to open the net device while

the

drivers/net/ethernet/intel/ice/ice_main.c +5 -0
+	 * asynchronous reset is still in progress, hitting -EBUSY.
+	 */
+	ret = ice_wait_for_reset(pf, 10 * HZ);
+	if (ret)
+		dev_err(dev, "Wait for reset failed during resume:

%d\n", ret);

drivers/net/ethernet/intel/ice/ice_main.c +1 -1
+
 	return 0;
 }
 
--
Quoted 1 line

2.43.0

Reviewed-by on v2 1/1
#2 lore raw
In reply to Aaron Ma
Quoted 34 lines · Aaron Ma

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

ice_resume()
ice_schedule_reset() # sets ICE_PFR_REQ, returns
...
ice_open()
ice_is_reset_in_progress() # ICE_PFR_REQ still set, -EBUSY
...
ice_service_task()
ice_do_reset()
ice_rebuild() # clears ICE_PFR_REQ, too late

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Wait for the reset to complete before returning from ice_resume().

Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

 drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5642

Quoted 8 lines
drivers/net/ethernet/intel/ice/ice_main.c +5 -0
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
 	/* Restart the service task */
 	mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
+	/* Best-effort wait for the scheduled reset to finish so that the
+	 * device is operational before returning. Without this, userspace
+	 * (e.g. NetworkManager) may try to open the net device while the
+	 * asynchronous reset is still in progress, hitting -EBUSY.
+	 */

Thanks for the update!

Quoted 10 lines
drivers/net/ethernet/intel/ice/ice_main.c +4 -0
+	ret = ice_wait_for_reset(pf, 10 * HZ);
+	if (ret)
+		dev_err(dev, "Wait for reset failed during resume: %d\n", ret);
+
 	return 0;
 }
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v2 1/1
#3 lore raw
In reply to Aaron Ma
Quoted 15 lines · Aaron Ma via Intel-wired-lan

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

   ice_resume()
     ice_schedule_reset()          # sets ICE_PFR_REQ, returns
   ...
   ice_open()
     ice_is_reset_in_progress()    # ICE_PFR_REQ still set, -EBUSY
   ...
   ice_service_task()
     ice_do_reset()
       ice_rebuild()               # clears ICE_PFR_REQ, too late
Quoted 8 lines

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Wait for the reset to complete before returning from ice_resume().

Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

thank you,

Quoted 26 lines

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

  drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
  1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +9 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
  	/* Restart the service task */
  	mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
+	/* Best-effort wait for the scheduled reset to finish so that the
+	 * device is operational before returning. Without this, userspace
+	 * (e.g. NetworkManager) may try to open the net device while the
+	 * asynchronous reset is still in progress, hitting -EBUSY.
+	 */
+	ret = ice_wait_for_reset(pf, 10 * HZ);
+	if (ret)
+		dev_err(dev, "Wait for reset failed during resume: %d\n", ret);
+
  	return 0;
  }
 
#4 lore raw
In reply to Aaron Ma

Dear Aaron,

Thank you for your patch.

Am 24.04.26 um 05:03 schrieb Aaron Ma via Intel-wired-lan:

Quoted 15 lines

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

   ice_resume()
     ice_schedule_reset()          # sets ICE_PFR_REQ, returns
   ...
   ice_open()
     ice_is_reset_in_progress()    # ICE_PFR_REQ still set, -EBUSY
   ...
   ice_service_task()
     ice_do_reset()
       ice_rebuild()               # clears ICE_PFR_REQ, too late
Quoted 2 lines

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Please document, how you reproduced it, and also paste possible messages by Linux or NetworkManager, so that people can easily search for the commit.

Quoted 1 line

Wait for the reset to complete before returning from ice_resume().

Please mention the delay length in the commit message.

Quoted 14 lines
Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

  drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
  1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5643

Quoted 9 lines
drivers/net/ethernet/intel/ice/ice_main.c +6 -0
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
  	/* Restart the service task */
  	mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
+	/* Best-effort wait for the scheduled reset to finish so that the
+	 * device is operational before returning. Without this, userspace
+	 * (e.g. NetworkManager) may try to open the net device while the
+	 * asynchronous reset is still in progress, hitting -EBUSY.
+	 */
+	ret = ice_wait_for_reset(pf, 10 * HZ);

Why not pass a delay in micro/milliseconds?

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5645

Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2 -0
+	if (ret)
+		dev_err(dev, "Wait for reset failed during resume: %d\n", ret);

Mention the delay?

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5649

Quoted 4 lines
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
+
  	return 0;
  }
 

Kind regards,

Paul

author
#5 lore raw
Quoted 22 lines · Paul Menzel

Dear Aaron,

Thank you for your patch.

Am 24.04.26 um 05:03 schrieb Aaron Ma via Intel-wired-lan:

Quoted 15 lines

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

   ice_resume()
     ice_schedule_reset()          # sets ICE_PFR_REQ, returns
   ...
   ice_open()
     ice_is_reset_in_progress()    # ICE_PFR_REQ still set, -EBUSY
   ...
   ice_service_task()
     ice_do_reset()
       ice_rebuild()               # clears ICE_PFR_REQ, too late
Quoted 6 lines
Quoted 2 lines

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Please document, how you reproduced it, and also paste possible messages by Linux or NetworkManager, so that people can easily search for the commit.

The error message is "can't open net device while reset is in progress" I can add it in v3 if you like.

Quoted 3 lines
Quoted 1 line

Wait for the reset to complete before returning from ice_resume().

Please mention the delay length in the commit message.

The timeout is 10 * HZ (10 seconds), matching the existing usage in ice_devlink_info_get() for the same ice_wait_for_reset() call. In practice the wait completes in ~300ms.

Quoted 18 lines
Quoted 18 lines
Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

  drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
  1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
      /* Restart the service task */
      mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
Quoted 8 lines

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5643

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_main.c +6 -0
+     /* Best-effort wait for the scheduled reset to finish so that the
+      * device is operational before returning. Without this, userspace
+      * (e.g. NetworkManager) may try to open the net device while the
+      * asynchronous reset is still in progress, hitting -EBUSY.
+      */
+     ret = ice_wait_for_reset(pf, 10 * HZ);

Why not pass a delay in micro/milliseconds?

ice_wait_for_reset() takes jiffies — that's the existing API.

Quoted 5 lines

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5645

Quoted 3 lines
drivers/net/ethernet/intel/ice/ice_main.c +2 -0
+     if (ret)
+             dev_err(dev, "Wait for reset failed during resume: %d\n", ret);

Mention the delay?

Good point. I'll include the timeout in the error message in v3.

Thanks,
Aaron

Quoted 10 lines

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5649

Quoted 5 lines
drivers/net/ethernet/intel/ice/ice_main.c +1 -0
+
      return 0;
  }
 

Kind regards,

Paul

#6 lore raw

Dear Aaron,

Thank you for your reply.

Am 28.04.26 um 09:53 schrieb Aaron Ma:

Quoted 18 lines · Paul Menzel
Quoted 17 lines

Am 24.04.26 um 05:03 schrieb Aaron Ma via Intel-wired-lan:

Quoted 15 lines

ice_resume() schedules an asynchronous PF reset and returns immediately. The reset runs later in ice_service_task(). If userspace tries to bring up the net device before the reset finishes, ice_open() fails with -EBUSY:

    ice_resume()
      ice_schedule_reset()          # sets ICE_PFR_REQ, returns
    ...
    ice_open()
      ice_is_reset_in_progress()    # ICE_PFR_REQ still set, -EBUSY
    ...
    ice_service_task()
      ice_do_reset()
        ice_rebuild()               # clears ICE_PFR_REQ, too late
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Reproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.

Please document, how you reproduced it, and also paste possible messages by Linux or NetworkManager, so that people can easily search for the commit.

The error message is "can't open net device while reset is in progress" I can add it in v3 if you like.

Yes, that’d be great.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Wait for the reset to complete before returning from ice_resume().

Please mention the delay length in the commit message.

The timeout is 10 * HZ (10 seconds), matching the existing usage in ice_devlink_info_get() for the same ice_wait_for_reset() call. In practice the wait completes in ~300ms.

I often wonder, where the delay values come from. Maybe mention, that you copied it.

Quoted 26 lines
Quoted 17 lines
Quoted 17 lines
Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")

---
v2: reword comment to clarify best-effort semantics (Kohei Enju)

   drivers/net/ethernet/intel/ice/ice_main.c | 9 +++++++++
   1 file changed, 9 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +0 -0
index 5f92377d4dfc2..a81eb21ea87c1 100644
@@ -5635,6 +5635,15 @@ static int ice_resume(struct device *dev)
       /* Restart the service task */
       mod_timer(&pf->serv_tmr, round_jiffies(jiffies + pf->serv_tmr_period));
 
Quoted 8 lines

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5643

Quoted 6 lines
drivers/net/ethernet/intel/ice/ice_main.c +6 -0
+     /* Best-effort wait for the scheduled reset to finish so that the
+      * device is operational before returning. Without this, userspace
+      * (e.g. NetworkManager) may try to open the net device while the
+      * asynchronous reset is still in progress, hitting -EBUSY.
+      */
+     ret = ice_wait_for_reset(pf, 10 * HZ);

Why not pass a delay in micro/milliseconds?

Quoted 1 line

ice_wait_for_reset() takes jiffies — that's the existing API.

It’s recommended to use msecs_to_jiffies() to make it HZ invariant.

Quoted 6 lines
Quoted 4 lines

drivers/net/ethernet/intel/ice/ice_main.c static int ice_resume(struct device *dev) · line 5645

Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c +2 -0
+     if (ret)
+             dev_err(dev, "Wait for reset failed during resume: %d\n", ret);

Mention the delay?

Good point. I'll include the timeout in the error message in v3.

Awesome.

[…]

Thanks,

Paul

maintainer
#7 lore raw
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

+     ret = ice_wait_for_reset(pf, 10 * HZ);

Why not pass a delay in micro/milliseconds?

ice_wait_for_reset() takes jiffies — that's the existing API.

It’s recommended to use msecs_to_jiffies() to make it HZ invariant.

there is also secs_to_jiffies()

Quoted 17 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

+     if (ret)
+             dev_err(dev, "Wait for reset failed during resume:
%d\n", ret);

Mention the delay?

Good point. I'll include the timeout in the error message in v3.

Awesome.

[…]

Thanks,

Paul

author
#8 lore raw
Quoted 11 lines · Przemek Kitszel
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

+ ret = ice_wait_for_reset(pf, 10 * HZ);

Why not pass a delay in micro/milliseconds?

ice_wait_for_reset() takes jiffies — that's the existing API.

It’s recommended to use msecs_to_jiffies() to make it HZ invariant.

there is also secs_to_jiffies()

Thank you very much.

V4 is sent.

Aaron

Quoted 19 lines
Quoted 18 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
(quoted diff) +2 -0
+     if (ret)
+             dev_err(dev, "Wait for reset failed during resume:

%d\n", ret);

Mention the delay?

Good point. I'll include the timeout in the error message in v3.

Awesome.

[…]

Thanks,

Paul