Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6b1bfd1 authored by Carolyn Wyborny's avatar Carolyn Wyborny Committed by Jeff Kirsher
Browse files

igb: Add check for invalid size to igb_get_invariants_82575()



Recent commits have changed how EEPROM size is checked and if the size
word is misconfigured, the driver will fail to load.  This patch adds a
check for invalid size word in the EEPROM and uses default size instead
for 82576 parts.

Reported-by: default avatarStefan 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 avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent ec7e97e9
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -244,6 +244,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)) {
		printk("igb: The NVM size is not valid, "
			"defaulting to 32K.\n");
		size = 15;
	}
	nvm->word_size = 1 << size;
	nvm->word_size = 1 << size;
	if (nvm->word_size == (1 << 15))
	if (nvm->word_size == (1 << 15))
		nvm->page_size = 128;
		nvm->page_size = 128;