Commit 7e5a313e authored by Mitch Williams's avatar Mitch Williams Committed by Jeff Kirsher

i40e: Added code to prevent double resets

Clear the VFLR bit after reset processing, instead of before. This
prevents double resets on VF init.
Signed-off-by: default avatarMitch Williams <mitch.a.williams@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent d3ce5734
...@@ -917,9 +917,9 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) ...@@ -917,9 +917,9 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
{ {
struct i40e_pf *pf = vf->pf; struct i40e_pf *pf = vf->pf;
struct i40e_hw *hw = &pf->hw; struct i40e_hw *hw = &pf->hw;
u32 reg, reg_idx, bit_idx;
bool rsd = false; bool rsd = false;
int i; int i;
u32 reg;
if (test_and_set_bit(__I40E_VF_DISABLE, &pf->state)) if (test_and_set_bit(__I40E_VF_DISABLE, &pf->state))
return; return;
...@@ -988,6 +988,11 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr) ...@@ -988,6 +988,11 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)
} }
/* tell the VF the reset is done */ /* tell the VF the reset is done */
wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE); wr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);
/* clear the VFLR bit in GLGEN_VFLRSTAT */
reg_idx = (hw->func_caps.vf_base_id + vf->vf_id) / 32;
bit_idx = (hw->func_caps.vf_base_id + vf->vf_id) % 32;
wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
i40e_flush(hw); i40e_flush(hw);
clear_bit(__I40E_VF_DISABLE, &pf->state); clear_bit(__I40E_VF_DISABLE, &pf->state);
} }
...@@ -2293,9 +2298,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf) ...@@ -2293,9 +2298,7 @@ int i40e_vc_process_vflr_event(struct i40e_pf *pf)
vf = &pf->vf[vf_id]; vf = &pf->vf[vf_id];
reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx)); reg = rd32(hw, I40E_GLGEN_VFLRSTAT(reg_idx));
if (reg & BIT(bit_idx)) { if (reg & BIT(bit_idx)) {
/* clear the bit in GLGEN_VFLRSTAT */ /* i40e_reset_vf will clear the bit in GLGEN_VFLRSTAT */
wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), BIT(bit_idx));
if (!test_bit(__I40E_DOWN, &pf->state)) if (!test_bit(__I40E_DOWN, &pf->state))
i40e_reset_vf(vf, true); i40e_reset_vf(vf, true);
} }
......
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