Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 256278
b: refs/heads/master
c: bed9829
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Jul 14, 2011
1 parent 731b739 commit bbc5533
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 168212858712b12c65e0fa1bec6c9c65808e7621
refs/heads/master: bed9829f3ec4b30d5cbec6511a11368ba5f169fb
27 changes: 17 additions & 10 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2657,14 +2657,19 @@ static void tg3_enable_register_access(struct tg3 *tp)

static int tg3_power_up(struct tg3 *tp)
{
tg3_enable_register_access(tp);
int err;

pci_set_power_state(tp->pdev, PCI_D0);
tg3_enable_register_access(tp);

/* Switch out of Vaux if it is a NIC */
tg3_pwrsrc_switch_to_vmain(tp);
err = pci_set_power_state(tp->pdev, PCI_D0);
if (!err) {
/* Switch out of Vaux if it is a NIC */
tg3_pwrsrc_switch_to_vmain(tp);
} else {
netdev_err(tp->dev, "Transition to D0 failed\n");
}

return 0;
return err;
}

static int tg3_power_down_prepare(struct tg3 *tp)
Expand Down Expand Up @@ -11433,8 +11438,12 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
{
struct tg3 *tp = netdev_priv(dev);

if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
tg3_power_up(tp);
if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) &&
tg3_power_up(tp)) {
etest->flags |= ETH_TEST_FL_FAILED;
memset(data, 1, sizeof(u64) * TG3_NUM_TEST);
return;
}

memset(data, 0, sizeof(u64) * TG3_NUM_TEST);

Expand Down Expand Up @@ -15571,10 +15580,8 @@ static pci_ers_result_t tg3_io_slot_reset(struct pci_dev *pdev)
}

err = tg3_power_up(tp);
if (err) {
netdev_err(netdev, "Failed to restore register access.\n");
if (err)
goto done;
}

rc = PCI_ERS_RESULT_RECOVERED;

Expand Down

0 comments on commit bbc5533

Please sign in to comment.