diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2008-04-02 18:03:23 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-02 18:33:53 +0200 |
commit | 063a0b38a7e4ade79f00314c473d3c41a2c7eecf (patch) | |
tree | ec3e97f8a213864ecce8c167bdaa428f094b2be2 /drivers/net/sky2.c | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb (diff) | |
download | linux-063a0b38a7e4ade79f00314c473d3c41a2c7eecf.tar.xz linux-063a0b38a7e4ade79f00314c473d3c41a2c7eecf.zip |
sky2: fix suspend/resume races
There are a couple of possible races on suspend/resume.
First the driver needs to block new packets from being queued for Tx.
The other less likely problem is the watchdog timer going off
during resume.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/net/sky2.c')
-rw-r--r-- | drivers/net/sky2.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 54c662690f65..853bce0ac478 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -4329,10 +4329,14 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) if (!hw) return 0; + del_timer_sync(&hw->watchdog_timer); + cancel_work_sync(&hw->restart_work); + for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; struct sky2_port *sky2 = netdev_priv(dev); + netif_device_detach(dev); if (netif_running(dev)) sky2_down(dev); @@ -4383,6 +4387,8 @@ static int sky2_resume(struct pci_dev *pdev) for (i = 0; i < hw->ports; i++) { struct net_device *dev = hw->dev[i]; + + netif_device_attach(dev); if (netif_running(dev)) { err = sky2_up(dev); if (err) { |