aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>2018-10-26 13:40:51 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-11-06 15:46:46 -0500
commitafd9d4ab58db20029a75cf82f23b6a5641cd7d6f (patch)
tree0ab4a997776eea0b94a7f284955100cc39e496f1 /drivers/net
parentce317dd9f809c8da9656c88761e30f0a82a8c2e6 (diff)
ice: Check for reset in progress during remove
The remove path does not currently check to see if a reset is in progress before proceeding. This can cause a resource collision resulting in various types of errors. Check for reset in progress and wait for a reasonable amount of time before allowing the remove to progress. Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/intel/ice/ice.h2
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 4c4b5717a627..e5b37fa60884 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -76,6 +76,8 @@ extern const char ice_drv_ver[];
76#define ICE_MIN_INTR_PER_VF (ICE_MIN_QS_PER_VF + 1) 76#define ICE_MIN_INTR_PER_VF (ICE_MIN_QS_PER_VF + 1)
77#define ICE_DFLT_INTR_PER_VF (ICE_DFLT_QS_PER_VF + 1) 77#define ICE_DFLT_INTR_PER_VF (ICE_DFLT_QS_PER_VF + 1)
78 78
79#define ICE_MAX_RESET_WAIT 20
80
79#define ICE_VSIQF_HKEY_ARRAY_SIZE ((VSIQF_HKEY_MAX_INDEX + 1) * 4) 81#define ICE_VSIQF_HKEY_ARRAY_SIZE ((VSIQF_HKEY_MAX_INDEX + 1) * 4)
80 82
81#define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK) 83#define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 6d31ffb64940..aee22f11a41a 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2182,6 +2182,12 @@ static void ice_remove(struct pci_dev *pdev)
2182 if (!pf) 2182 if (!pf)
2183 return; 2183 return;
2184 2184
2185 for (i = 0; i < ICE_MAX_RESET_WAIT; i++) {
2186 if (!ice_is_reset_in_progress(pf->state))
2187 break;
2188 msleep(100);
2189 }
2190
2185 set_bit(__ICE_DOWN, pf->state); 2191 set_bit(__ICE_DOWN, pf->state);
2186 ice_service_task_stop(pf); 2192 ice_service_task_stop(pf);
2187 2193