i40e: clean event descriptor before use
In one obscure corner case, it was possible to clear the NVM update wait flag when no update_done message was actually received. This patch cleans the event descriptor before use, and moves the opcode check to where it won't get done if there was no event to clean. Also update copyright year in file headers. Change-ID: I68bbc41965e93f4adf07cbe98b9dfd63d41509a4 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
9b9344f7ce
commit
73b03f9848
|
@ -1,7 +1,7 @@
|
|||
/*******************************************************************************
|
||||
*
|
||||
* Intel Ethernet Controller XL710 Family Linux Driver
|
||||
* Copyright(c) 2013 - 2014 Intel Corporation.
|
||||
* Copyright(c) 2013 - 2016 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
|
@ -953,6 +953,9 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
|
|||
u16 flags;
|
||||
u16 ntu;
|
||||
|
||||
/* pre-clean the event info */
|
||||
memset(&e->desc, 0, sizeof(e->desc));
|
||||
|
||||
/* take the lock before we start messing with the ring */
|
||||
mutex_lock(&hw->aq.arq_mutex);
|
||||
|
||||
|
@ -1020,14 +1023,6 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
|
|||
hw->aq.arq.next_to_clean = ntc;
|
||||
hw->aq.arq.next_to_use = ntu;
|
||||
|
||||
clean_arq_element_out:
|
||||
/* Set pending if needed, unlock and return */
|
||||
if (pending != NULL)
|
||||
*pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
|
||||
|
||||
clean_arq_element_err:
|
||||
mutex_unlock(&hw->aq.arq_mutex);
|
||||
|
||||
if (i40e_is_nvm_update_op(&e->desc)) {
|
||||
if (hw->aq.nvm_release_on_done) {
|
||||
i40e_release_nvm(hw);
|
||||
|
@ -1048,6 +1043,13 @@ clean_arq_element_err:
|
|||
}
|
||||
}
|
||||
|
||||
clean_arq_element_out:
|
||||
/* Set pending if needed, unlock and return */
|
||||
if (pending)
|
||||
*pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
|
||||
clean_arq_element_err:
|
||||
mutex_unlock(&hw->aq.arq_mutex);
|
||||
|
||||
return ret_code;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*******************************************************************************
|
||||
*
|
||||
* Intel Ethernet Controller XL710 Family Linux Virtual Function Driver
|
||||
* Copyright(c) 2013 - 2014 Intel Corporation.
|
||||
* Copyright(c) 2013 - 2016 Intel Corporation.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
|
@ -887,6 +887,9 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw,
|
|||
u16 flags;
|
||||
u16 ntu;
|
||||
|
||||
/* pre-clean the event info */
|
||||
memset(&e->desc, 0, sizeof(e->desc));
|
||||
|
||||
/* take the lock before we start messing with the ring */
|
||||
mutex_lock(&hw->aq.arq_mutex);
|
||||
|
||||
|
|
Loading…
Reference in New Issue