]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: clean event descriptor before use
authorShannon Nelson <shannon.nelson@intel.com>
Fri, 15 Jan 2016 22:33:20 +0000 (14:33 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 10 Mar 2016 16:37:32 +0000 (08:37 -0800)
Orabug: 22342532

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>
(cherry picked from commit 73b03f9848aa7556c8a10fd6ad4e64254e493445)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/intel/i40e/i40e_adminq.c

drivers/net/ethernet/intel/i40e/i40e_adminq.c
drivers/net/ethernet/intel/i40evf/i40e_adminq.c

index 21b7cc9179a3d512dbad0af36a965b0002302766..d0dcaf17e74d7faa28bf83c4e71957f2cff5f809 100644 (file)
@@ -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);
 
@@ -1013,12 +1016,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);
-       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);
@@ -1039,6 +1036,13 @@ clean_arq_element_out:
                }
        }
 
+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;
 }
 
index d91ebdc8966be245c7a10d5bcc11fd7719aac1e6..fc17892cced52b4678e930c749bcc672288fb4ee 100644 (file)
@@ -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);