Skip to content

Commit

Permalink
[TG3]: Fix suspend and resume
Browse files Browse the repository at this point in the history
Fix tg3_suspend() and tg3_resume() by clearing and setting the
TG3_FLAG_INIT_COMPLETE flag when appropriate. tg3_set_power_state()
looks at TG3_FLAG_INIT_COMPLETE on the peer device to determine
when to appropriately switch to aux power.  

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michael Chan authored and David S. Miller committed Dec 14, 2005
1 parent 381291b commit 6a9eba1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -10826,12 +10826,14 @@ static int tg3_suspend(struct pci_dev *pdev, pm_message_t state)

tg3_full_lock(tp, 0);
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
tg3_full_unlock(tp);

err = tg3_set_power_state(tp, pci_choose_state(pdev, state));
if (err) {
tg3_full_lock(tp, 0);

tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
tg3_init_hw(tp);

tp->timer.expires = jiffies + tp->timer_offset;
Expand Down Expand Up @@ -10865,6 +10867,7 @@ static int tg3_resume(struct pci_dev *pdev)

tg3_full_lock(tp, 0);

tp->tg3_flags |= TG3_FLAG_INIT_COMPLETE;
tg3_init_hw(tp);

tp->timer.expires = jiffies + tp->timer_offset;
Expand Down

0 comments on commit 6a9eba1

Please sign in to comment.