From: Carolyn Wyborny <carolyn.wybo...@intel.com>

This patch fixes an issue where adminq init failures always provided
a message that NVM was newer than expected.  This is not always the
case for init_adminq failures. Without this patch, if adminq init
fails for any reason, newer NVM message would be given.  This
problem is fixed by adding  a check for that specific error
condition and a different hopefully helpful message otherwise.

Change-ID: Iaeaebee4e398989eae40bb70f943ab66a3a521a5
Signed-off-by: Carolyn Wyborny <carolyn.wybo...@intel.com>
Tested-by: Andrew Bowers <andrewx.bow...@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirs...@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c 
b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 491c82f..508cf9a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -10471,6 +10471,16 @@ static int i40e_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
        pf->hw.fc.requested_mode = I40E_FC_NONE;
 
        err = i40e_init_adminq(hw);
+       if (err) {
+               if (err == I40E_ERR_FIRMWARE_API_VERSION)
+                       dev_info(&pdev->dev,
+                                "The driver for the device stopped because the 
NVM image is newer than expected. You must install the most recent version of 
the network driver.\n");
+               else
+                       dev_info(&pdev->dev,
+                                "The driver for the device stopped because the 
device firmware failed to init. Try updating your NVM image.\n");
+
+               goto err_pf_reset;
+       }
 
        /* provide nvm, fw, api versions */
        dev_info(&pdev->dev, "fw %d.%d.%05d api %d.%d nvm %s\n",
@@ -10478,12 +10488,6 @@ static int i40e_probe(struct pci_dev *pdev, const 
struct pci_device_id *ent)
                 hw->aq.api_maj_ver, hw->aq.api_min_ver,
                 i40e_nvm_version_str(hw));
 
-       if (err) {
-               dev_info(&pdev->dev,
-                        "The driver for the device stopped because the NVM 
image is newer than expected. You must install the most recent version of the 
network driver.\n");
-               goto err_pf_reset;
-       }
-
        if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
            hw->aq.api_min_ver > I40E_FW_API_VERSION_MINOR)
                dev_info(&pdev->dev,
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to