[TG3]: Fix suspend and resume
authorMichael Chan <mchan@broadcom.com>
Wed, 14 Dec 2005 05:08:58 +0000 (21:08 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Dec 2005 05:08:58 +0000 (21:08 -0800)
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>
drivers/net/tg3.c

index dabc39befd3cf9030dd618191ea2281946184ef9..6b7ab4b7275295bd84f8cd830f08a8e85907339c 100644 (file)
@@ -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;
@@ -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;