i40e: let firmware catch the NVM busy error
authorShannon Nelson <shannon.nelson@intel.com>
Thu, 13 Nov 2014 08:23:14 +0000 (08:23 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 9 Dec 2014 20:57:02 +0000 (12:57 -0800)
The NVM update operations take time finish asynchronously, and follow-on
update requests need to wait for the current one to finish.  Early
firmware didn't handle this well, so the code had to track the busy state.
The released firmware handles the busy state correctly, returning
I40E_AQ_RC_EBUSY if an update is still in progress, so the code no longer
needs to track this.

Change-ID: I6e6b4adc26d6dcc5fd7adfee5763423858a7d921
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40e/i40e_adminq.h
drivers/net/ethernet/intel/i40evf/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40e_adminq.h

index 35fa09a2c16261e3e7e10d9acbc820448d7e0a26..ebff11bdc09b2f4e0535584e054e5ebf5fc9d7e5 100644 (file)
@@ -617,7 +617,6 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
 
        /* pre-emptive resource lock release */
        i40e_aq_release_resource(hw, I40E_NVM_RESOURCE_ID, 0, NULL);
-       hw->aq.nvm_busy = false;
 
        ret_code = i40e_aq_set_hmc_resource_profile(hw,
                                                    I40E_HMC_PROFILE_DEFAULT,
@@ -754,12 +753,6 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
                goto asq_send_command_exit;
        }
 
-       if (i40e_is_nvm_update_op(desc) && hw->aq.nvm_busy) {
-               i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQTX: NVM busy.\n");
-               status = I40E_ERR_NVM;
-               goto asq_send_command_exit;
-       }
-
        details = I40E_ADMINQ_DETAILS(hw->aq.asq, hw->aq.asq.next_to_use);
        if (cmd_details) {
                *details = *cmd_details;
@@ -901,9 +894,6 @@ i40e_status i40e_asq_send_command(struct i40e_hw *hw,
                status = I40E_ERR_ADMIN_QUEUE_TIMEOUT;
        }
 
-       if (!status && i40e_is_nvm_update_op(desc))
-               hw->aq.nvm_busy = true;
-
 asq_send_command_error:
        mutex_unlock(&hw->aq.asq_mutex);
 asq_send_command_exit:
@@ -1016,7 +1006,6 @@ clean_arq_element_out:
        mutex_unlock(&hw->aq.arq_mutex);
 
        if (i40e_is_nvm_update_op(&e->desc)) {
-               hw->aq.nvm_busy = false;
                if (hw->aq.nvm_release_on_done) {
                        i40e_release_nvm(hw);
                        hw->aq.nvm_release_on_done = false;
index 003a227b8515a610bbcd7aa761074d5693d774a9..618fe9623b6d15842efada93fcc86a59bb47736c 100644 (file)
@@ -94,7 +94,6 @@ struct i40e_adminq_info {
        u16 fw_min_ver;                 /* firmware minor version */
        u16 api_maj_ver;                /* api major version */
        u16 api_min_ver;                /* api minor version */
-       bool nvm_busy;
        bool nvm_release_on_done;
 
        struct mutex asq_mutex; /* Send queue lock */
index 16989946c52a0fc093f7c964c7983d0bd3ba752c..c1d25f8c1abca3276550d1932176f78f39b6859e 100644 (file)
@@ -836,9 +836,6 @@ i40e_status i40evf_asq_send_command(struct i40e_hw *hw,
                hw->aq.asq_last_status = (enum i40e_admin_queue_err)retval;
        }
 
-       if (i40e_is_nvm_update_op(desc))
-               hw->aq.nvm_busy = true;
-
        i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
                   "AQTX: desc and buffer writeback:\n");
        i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff,
@@ -931,9 +928,6 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
                memcpy(e->msg_buf, hw->aq.arq.r.arq_bi[desc_idx].va,
                       e->msg_len);
 
-       if (i40e_is_nvm_update_op(&e->desc))
-               hw->aq.nvm_busy = false;
-
        i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, "AQRX: desc and buffer:\n");
        i40evf_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, e->msg_buf,
                        hw->aq.arq_buf_size);
index 0d58378be7406bcadfade1e30d628be3409421e6..d5d3c9310d2d47dbdf07f8c878ce724c38a20ea2 100644 (file)
@@ -94,7 +94,6 @@ struct i40e_adminq_info {
        u16 fw_min_ver;                 /* firmware minor version */
        u16 api_maj_ver;                /* api major version */
        u16 api_min_ver;                /* api minor version */
-       bool nvm_busy;
        bool nvm_release_on_done;
 
        struct mutex asq_mutex; /* Send queue lock */