e1000e: Only run S0ix flows if shutdown succeeded
authorMario Limonciello <mario.limonciello@dell.com>
Mon, 14 Dec 2020 19:29:32 +0000 (13:29 -0600)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 23 Dec 2020 23:18:33 +0000 (15:18 -0800)
If the shutdown failed, the part will be thawed and running
S0ix flows will put it into an undefined state.

Reported-by: Alexander Duyck <alexander.duyck@gmail.com>
Reviewed-by: Alexander Duyck <alexander.duyck@gmail.com>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
Tested-by: Yijun Shen <Yijun.shen@dell.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/e1000e/netdev.c

index 128ab6898070e0262e0756fb6ef6c9209ab3577c..6588f5d4a2be835401a2bfbe65134183bc697383 100644 (file)
@@ -6970,13 +6970,14 @@ static __maybe_unused int e1000e_pm_suspend(struct device *dev)
        e1000e_pm_freeze(dev);
 
        rc = __e1000_shutdown(pdev, false);
-       if (rc)
+       if (rc) {
                e1000e_pm_thaw(dev);
-
-       /* Introduce S0ix implementation */
-       if (hw->mac.type >= e1000_pch_cnp &&
-           !e1000e_check_me(hw->adapter->pdev->device))
-               e1000e_s0ix_entry_flow(adapter);
+       } else {
+               /* Introduce S0ix implementation */
+               if (hw->mac.type >= e1000_pch_cnp &&
+                   !e1000e_check_me(hw->adapter->pdev->device))
+                       e1000e_s0ix_entry_flow(adapter);
+       }
 
        return rc;
 }