igb: Don't let ethtool try to write to iNVM in i210/i211
authorFujinaka, Todd <todd.fujinaka@intel.com>
Wed, 23 Oct 2013 05:52:11 +0000 (05:52 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 1 Nov 2013 13:04:52 +0000 (06:04 -0700)
Don't let ethtool try to write to iNVM in i210/i211.

This fixes an issue seen by Marek Vasut.

Reported-by: Marek Vasut <marex@denx.de>
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igb/igb_ethtool.c

index 0ae3177416c736ea5c48b2eead34a2c0553f7368..b918ba3640f9115dd829ec9af4cf83a4a9ddbf49 100644 (file)
@@ -771,8 +771,10 @@ static int igb_set_eeprom(struct net_device *netdev,
        if (eeprom->len == 0)
                return -EOPNOTSUPP;
 
-       if (hw->mac.type == e1000_i211)
+       if ((hw->mac.type >= e1000_i210) &&
+           !igb_get_flash_presence_i210(hw)) {
                return -EOPNOTSUPP;
+       }
 
        if (eeprom->magic != (hw->vendor_id | (hw->device_id << 16)))
                return -EFAULT;