Commit 925b11f7 authored by Carolyn Wyborny's avatar Carolyn Wyborny Committed by Peter P Waskiewicz Jr

igb: Fix for failure to init on some 82576 devices.

Move nvm invalid size check to before size assigned by mac_type for
82575 and later parts in get_invariants function.  This fixes a problem
found on some 82576 devices where the part will not initialize because
the nvm_read function pointer ends up getting assigned to the incorrect
function.

Reported By: Stefan Assmann <sassmann@redhat.com>
Signed-off-by: default avatarCarolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
parent ff6e1225
...@@ -254,6 +254,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) ...@@ -254,6 +254,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
*/ */
size += NVM_WORD_SIZE_BASE_SHIFT; size += NVM_WORD_SIZE_BASE_SHIFT;
/*
* Check for invalid size
*/
if ((hw->mac.type == e1000_82576) && (size > 15)) {
pr_notice("The NVM size is not valid, defaulting to 32K\n");
size = 15;
}
nvm->word_size = 1 << size; nvm->word_size = 1 << size;
if (hw->mac.type < e1000_i210) { if (hw->mac.type < e1000_i210) {
nvm->opcode_bits = 8; nvm->opcode_bits = 8;
...@@ -281,14 +289,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) ...@@ -281,14 +289,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
} else } else
nvm->type = e1000_nvm_flash_hw; nvm->type = e1000_nvm_flash_hw;
/*
* Check for invalid size
*/
if ((hw->mac.type == e1000_82576) && (size > 15)) {
pr_notice("The NVM size is not valid, defaulting to 32K\n");
size = 15;
}
/* NVM Function Pointers */ /* NVM Function Pointers */
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82580: case e1000_82580:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment