Commit 94075bb1 authored by Filip Sadowski's avatar Filip Sadowski Committed by Jeff Kirsher

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: default avatarFilip Sadowski <filip.sadowski@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent e56afa59
...@@ -1269,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw) ...@@ -1269,6 +1269,7 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
* we don't need to do the PF Reset * we don't need to do the PF Reset
*/ */
if (!cnt) { if (!cnt) {
u32 reg2 = 0;
if (hw->revision_id == 0) if (hw->revision_id == 0)
cnt = I40E_PF_RESET_WAIT_COUNT_A0; cnt = I40E_PF_RESET_WAIT_COUNT_A0;
else else
...@@ -1280,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw) ...@@ -1280,6 +1281,12 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
reg = rd32(hw, I40E_PFGEN_CTRL); reg = rd32(hw, I40E_PFGEN_CTRL);
if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK)) if (!(reg & I40E_PFGEN_CTRL_PFSWR_MASK))
break; break;
reg2 = rd32(hw, I40E_GLGEN_RSTAT);
if (reg2 & I40E_GLGEN_RSTAT_DEVSTATE_MASK) {
hw_dbg(hw, "Core reset upcoming. Skipping PF reset request.\n");
hw_dbg(hw, "I40E_GLGEN_RSTAT = 0x%x\n", reg2);
return I40E_ERR_NOT_READY;
}
usleep_range(1000, 2000); usleep_range(1000, 2000);
} }
if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) { if (reg & I40E_PFGEN_CTRL_PFSWR_MASK) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment