diff options
author | Filip Sadowski <filip.sadowski@intel.com> | 2017-11-14 07:00:49 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2017-11-22 02:36:05 -0500 |
commit | 94075bb1ed7c89cdf4c46eca3938ac4f087827af (patch) | |
tree | 0eb69e5d52f3d48afbcb617202ca3b86a69b87eb | |
parent | e56afa599609d3afe8b0ce24b553ab95e9782502 (diff) |
i40e: Fix FLR reset timeout issue
This patch allows detection of upcoming core reset in case NIC gets
stuck while performing FLR reset. The i40e_pf_reset() function returns
I40E_ERR_NOT_READY when global reset was detected.
Signed-off-by: Filip Sadowski <filip.sadowski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 13c79468a6da..095965f268bd 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -1269,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw) | |||
1269 | * we don't need to do the PF Reset | 1269 | * we don't need to do the PF Reset |
1270 | */ | 1270 | */ |
1271 | if (!cnt) { | 1271 | if (!cnt) { |
1272 | u32 reg2 = 0; | ||
1272 | if (hw->revision_id == 0) | 1273 | if (hw->revision_id == 0) |
1273 | cnt = I40E_PF_RESET_WAIT_COUNT_A0; | 1274 | cnt = I40E_PF_RESET_WAIT_COUNT_A0; |
1274 | else | 1275 | else |
@@ -1280,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw) | |||
1280 | reg = rd32(hw, I40E_PFGEN_CTRL); | 1281 | reg = rd32(hw, I40E_PFGEN_CTRL); |
1281 | if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) | 1282 | if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) |
1282 | break; | 1283 | break; |
1284 | reg2 = rd32(hw, I40E_GLGEN_RSTAT); | ||
1285 | if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) { | ||
1286 | hw_dbg(hw, "Core reset upcoming. Skipping PF reset request.\n"); | ||
1287 | hw_dbg(hw, "I40E_GLGEN_RSTAT = 0x%x\n", reg2); | ||
1288 | return I40E_ERR_NOT_READY; | ||
1289 | } | ||
1283 | usleep_range(1000, 2000); | 1290 | usleep_range(1000, 2000); |
1284 | } | 1291 | } |
1285 | if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { | 1292 | if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { |