tg3: Allow NVRAM programming when interface is down

Previously, when the interface was brought down, the driver would set
the power state to D3hot. In D3hot, we don't have access to the NVRAM.
This patch removes the call to set the power state to PCI_D3hot in
close. A following patch will implement the shutdown handler to properly
set the D3hot state when the system is going down.

Doing the above means that the TG3_PHYFLG_IS_LOW_POWER should not be
checked to validate access to the NVRAM.

Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Nithin Sujir 2013-07-29 13:58:36 -07:00 committed by David S. Miller
parent c1459356d9
commit 5137a2ee20
1 changed files with 2 additions and 8 deletions

View File

@ -11502,7 +11502,7 @@ static int tg3_close(struct net_device *dev)
memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev)); memset(&tp->net_stats_prev, 0, sizeof(tp->net_stats_prev));
memset(&tp->estats_prev, 0, sizeof(tp->estats_prev)); memset(&tp->estats_prev, 0, sizeof(tp->estats_prev));
tg3_power_down(tp); tg3_power_down_prepare(tp);
tg3_carrier_off(tp); tg3_carrier_off(tp);
@ -11724,9 +11724,6 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if (tg3_flag(tp, NO_NVRAM)) if (tg3_flag(tp, NO_NVRAM))
return -EINVAL; return -EINVAL;
if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
return -EAGAIN;
offset = eeprom->offset; offset = eeprom->offset;
len = eeprom->len; len = eeprom->len;
eeprom->len = 0; eeprom->len = 0;
@ -11784,9 +11781,6 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
u8 *buf; u8 *buf;
__be32 start, end; __be32 start, end;
if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
return -EAGAIN;
if (tg3_flag(tp, NO_NVRAM) || if (tg3_flag(tp, NO_NVRAM) ||
eeprom->magic != TG3_EEPROM_MAGIC) eeprom->magic != TG3_EEPROM_MAGIC)
return -EINVAL; return -EINVAL;
@ -13515,7 +13509,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
tg3_phy_start(tp); tg3_phy_start(tp);
} }
if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
tg3_power_down(tp); tg3_power_down_prepare(tp);
} }