提交 981e25c3 编写于 作者: P Paul M Stillwell Jr 提交者: Jeff Kirsher

i40e: Handle admin Q timeout when releasing NVM

There are some rare cases where the release resource call will return an
admin Q timeout. In these cases the code needs to try to release the
resource again until it succeeds or it times out.
Signed-off-by: NPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 4d5957cb
...@@ -134,8 +134,25 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw, ...@@ -134,8 +134,25 @@ i40e_status i40e_acquire_nvm(struct i40e_hw *hw,
**/ **/
void i40e_release_nvm(struct i40e_hw *hw) void i40e_release_nvm(struct i40e_hw *hw)
{ {
if (!hw->nvm.blank_nvm_mode) i40e_status ret_code = I40E_SUCCESS;
i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL); u32 total_delay = 0;
if (hw->nvm.blank_nvm_mode)
return;
ret_code = i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
/* there are some rare cases when trying to release the resource
* results in an admin Q timeout, so handle them correctly
*/
while ((ret_code == I40E_ERR_ADMIN_QUEUE_TIMEOUT) &&
(total_delay < hw->aq.asq_cmd_timeout)) {
usleep_range(1000, 2000);
ret_code = i40e_aq_release_resource(hw,
I40E_NVM_RESOURCE_ID,
0, NULL);
total_delay++;
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册