diff options
author | Carolyn Wyborny <carolyn.wyborny@intel.com> | 2012-07-30 21:01:23 -0400 |
---|---|---|
committer | Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> | 2012-08-04 05:43:47 -0400 |
commit | 925b11f706642732ce2ae53b0f0d3fd54adc5075 (patch) | |
tree | 606bc9c9922e25fc805f35e5a73112f7e64e5981 /drivers/net | |
parent | ff6e1225957cce9e93b8d84dc240e5a44094d0ec (diff) |
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: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ethernet/intel/igb/e1000_82575.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c index 5e84eaac48c1..ba994fb4cec6 100644 --- a/drivers/net/ethernet/intel/igb/e1000_82575.c +++ b/drivers/net/ethernet/intel/igb/e1000_82575.c | |||
@@ -254,6 +254,14 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
254 | */ | 254 | */ |
255 | size += NVM_WORD_SIZE_BASE_SHIFT; | 255 | size += NVM_WORD_SIZE_BASE_SHIFT; |
256 | 256 | ||
257 | /* | ||
258 | * Check for invalid size | ||
259 | */ | ||
260 | if ((hw->mac.type == e1000_82576) && (size > 15)) { | ||
261 | pr_notice("The NVM size is not valid, defaulting to 32K\n"); | ||
262 | size = 15; | ||
263 | } | ||
264 | |||
257 | nvm->word_size = 1 << size; | 265 | nvm->word_size = 1 << size; |
258 | if (hw->mac.type < e1000_i210) { | 266 | if (hw->mac.type < e1000_i210) { |
259 | nvm->opcode_bits = 8; | 267 | nvm->opcode_bits = 8; |
@@ -281,14 +289,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
281 | } else | 289 | } else |
282 | nvm->type = e1000_nvm_flash_hw; | 290 | nvm->type = e1000_nvm_flash_hw; |
283 | 291 | ||
284 | /* | ||
285 | * Check for invalid size | ||
286 | */ | ||
287 | if ((hw->mac.type == e1000_82576) && (size > 15)) { | ||
288 | pr_notice("The NVM size is not valid, defaulting to 32K\n"); | ||
289 | size = 15; | ||
290 | } | ||
291 | |||
292 | /* NVM Function Pointers */ | 292 | /* NVM Function Pointers */ |
293 | switch (hw->mac.type) { | 293 | switch (hw->mac.type) { |
294 | case e1000_82580: | 294 | case e1000_82580: |