Commit d4946cf5 authored by Shannon Nelson's avatar Shannon Nelson Committed by Jeff Kirsher

i40e: retry call on timeout

If the admin queue times out, retry some more to make driver load and
reset more robust.

Change-Id: I45c977b3d10a62c770d6072659ec27834849ca33
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Signed-off-by: default avatarJesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent d52cf0a9
...@@ -535,8 +535,9 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw) ...@@ -535,8 +535,9 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
**/ **/
i40e_status i40e_init_adminq(struct i40e_hw *hw) i40e_status i40e_init_adminq(struct i40e_hw *hw)
{ {
u16 eetrack_lo, eetrack_hi;
i40e_status ret_code; i40e_status ret_code;
u16 eetrack_lo, eetrack_hi;
int retry = 0;
/* verify input for valid configuration */ /* verify input for valid configuration */
if ((hw->aq.num_arq_entries == 0) || if ((hw->aq.num_arq_entries == 0) ||
...@@ -564,11 +565,24 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw) ...@@ -564,11 +565,24 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
if (ret_code) if (ret_code)
goto init_adminq_free_asq; goto init_adminq_free_asq;
ret_code = i40e_aq_get_firmware_version(hw, /* There are some cases where the firmware may not be quite ready
&hw->aq.fw_maj_ver, &hw->aq.fw_min_ver, * for AdminQ operations, so we retry the AdminQ setup a few times
&hw->aq.api_maj_ver, &hw->aq.api_min_ver, * if we see timeouts in this first AQ call.
NULL); */
if (ret_code) do {
ret_code = i40e_aq_get_firmware_version(hw,
&hw->aq.fw_maj_ver,
&hw->aq.fw_min_ver,
&hw->aq.api_maj_ver,
&hw->aq.api_min_ver,
NULL);
if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT)
break;
retry++;
msleep(100);
i40e_resume_aq(hw);
} while (retry < 10);
if (ret_code != I40E_SUCCESS)
goto init_adminq_free_arq; goto init_adminq_free_arq;
if (hw->aq.api_maj_ver != I40E_FW_API_VERSION_MAJOR || if (hw->aq.api_maj_ver != I40E_FW_API_VERSION_MAJOR ||
......
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