]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ice: wait for reset completion in ice_resume()
authorAaron Ma <aaron.ma@canonical.com>
Wed, 29 Apr 2026 03:48:49 +0000 (11:48 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 28 Jul 2026 18:23:01 +0000 (11:23 -0700)
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.

Fixes: 769c500dcc1e ("ice: Add advanced power mgmt for WoL")
Cc: stable@vger.kernel.org
Reviewed-by: Kohei Enju <kohei@enjuk.jp>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Tested-by: Alexander Nowlin <alexander.nowlin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index e2fd2dab03e3636c1ee8cca530393676dc6f3922..d88835482d3aac2654f1fc0fad57ee05a550752c 100644 (file)
@@ -5637,6 +5637,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;
 }