ice: wait for reset completion in ice_resume()
Subsystems (3)
PATCH v4 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.
ice 0000:81:00.0: can't open net device while reset is in progress
Add a best-effort wait (10s timeout, matching ice_devlink_info_get()) for the reset to complete before returning from ice_resume(). In practice the reset completes in ~300ms.
---
v4: use secs_to_jiffies() instead of 10 * HZ (Przemek Kitszel)
v3: add error message to commit message for searchability, mention
timeout in dev_err (Paul Menzel)
v2: reword comment to clarify best-effort semantics (Kohei Enju)
v1: https://lore.kernel.org/intel-wired-lan/[email protected]/
drivers/net/ethernet/intel/ice/ice_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/intel/ice/ice_main.c +10 -0
@@ -5635,6 +5635,16 @@ 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,secs_to_jiffies (10 )); +if (ret) +dev_err (dev,"Wait for reset timed out (10s) during resume: %d\n" , + ret); +return 0 ; }
Signature · 1 line
2.43.0
Quoted 24 lines · Aaron Ma via Intel-wired-lan
ice_resume()schedules an asynchronous PF reset and returns immediately. The reset runs later inice_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()# setsICE_PFR_REQ, returns
...
ice_open()
ice_is_reset_in_progress()#ICE_PFR_REQstill set,-EBUSY
...
ice_service_task()
ice_do_reset()
ice_rebuild()# clearsICE_PFR_REQ, too lateReproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.
ice 0000:81:00.0: can't open net device while reset is in progress
Add a best-effort wait (10s timeout, matching
ice_devlink_info_get()) for the reset to complete before returning fromice_resume(). In practice the reset completes in ~300ms.
Quoted 6 lines
Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")Reviewed-by Kohei Enju <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Aaron Ma <[email protected]>
This doesn't specify a tree target, but given the cc to stable and the fixes tag, I think this belongs on net, so I'll queue it for the iwl-net dev-queue.
Thanks,
Jake
Quoted 38 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Aaron Ma via Intel-wired-lan
Sent: Tuesday, April 28, 2026 8:49 PM
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]; [email protected]
Cc: Akeem G Abodunrin <[email protected]>; Jesse Brandeburg <[email protected]>; [email protected]; Loktionov, Aleksandr <[email protected]>; [email protected]; Paul Menzel <[email protected]>
Subject: [Intel-wired-lan] [PATCH v4] ice: wait for reset completion inice_resume()
ice_resume()schedules an asynchronous PF reset and returns immediately. The reset runs later inice_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()# setsICE_PFR_REQ, returns
...
ice_open()
ice_is_reset_in_progress()#ICE_PFR_REQstill set,-EBUSY
...
ice_service_task()
ice_do_reset()
ice_rebuild()# clearsICE_PFR_REQ, too lateReproduced on E800 series NICs during suspend/resume with irdma enabled, where the aux device probe widens the race window.
ice 0000:81:00.0: can't open net device while reset is in progress
Add a best-effort wait (10s timeout, matching
ice_devlink_info_get()) for the reset to complete before returning fromice_resume(). In practice the reset completes in ~300ms.Fixes 769c500dcc1e ("ice: Add advanced power mgmt for WoL")Reviewed-by Kohei Enju <[email protected]>Reviewed-by Aleksandr Loktionov <[email protected]>Reviewed-by Przemek Kitszel <[email protected]>Signed-off-by Aaron Ma <[email protected]>---
v4: usesecs_to_jiffies()instead of 10 * HZ (Przemek Kitszel)
v3: add error message to commit message for searchability, mention
timeout indev_err(Paul Menzel)
v2: reword comment to clarify best-effort semantics (Kohei Enju)
v1: https://lore.kernel.org/intel-wired-lan/[email protected]/
Quoted 2 lines
drivers/net/ethernet/intel/ice/ice_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)