aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/sky2.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index df899dcbd5b0..97fe95666f3b 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -2161,6 +2161,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port,
2161/* If idle then force a fake soft NAPI poll once a second 2161/* If idle then force a fake soft NAPI poll once a second
2162 * to work around cases where sharing an edge triggered interrupt. 2162 * to work around cases where sharing an edge triggered interrupt.
2163 */ 2163 */
2164static inline void sky2_idle_start(struct sky2_hw *hw)
2165{
2166 if (idle_timeout > 0)
2167 mod_timer(&hw->idle_timer,
2168 jiffies + msecs_to_jiffies(idle_timeout));
2169}
2170
2164static void sky2_idle(unsigned long arg) 2171static void sky2_idle(unsigned long arg)
2165{ 2172{
2166 struct sky2_hw *hw = (struct sky2_hw *) arg; 2173 struct sky2_hw *hw = (struct sky2_hw *) arg;
@@ -3350,9 +3357,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
3350 sky2_write32(hw, B0_IMSK, Y2_IS_BASE); 3357 sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
3351 3358
3352 setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw); 3359 setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
3353 if (idle_timeout > 0) 3360 sky2_idle_start(hw);
3354 mod_timer(&hw->idle_timer,
3355 jiffies + msecs_to_jiffies(idle_timeout));
3356 3361
3357 pci_set_drvdata(pdev, hw); 3362 pci_set_drvdata(pdev, hw);
3358 3363
@@ -3430,6 +3435,8 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
3430 if (!(pstate == PCI_D3hot || pstate == PCI_D3cold)) 3435 if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
3431 return -EINVAL; 3436 return -EINVAL;
3432 3437
3438 del_timer_sync(&hw->idle_timer);
3439
3433 for (i = 0; i < hw->ports; i++) { 3440 for (i = 0; i < hw->ports; i++) {
3434 struct net_device *dev = hw->dev[i]; 3441 struct net_device *dev = hw->dev[i];
3435 3442
@@ -3472,10 +3479,12 @@ static int sky2_resume(struct pci_dev *pdev)
3472 printk(KERN_ERR PFX "%s: could not up: %d\n", 3479 printk(KERN_ERR PFX "%s: could not up: %d\n",
3473 dev->name, err); 3480 dev->name, err);
3474 dev_close(dev); 3481 dev_close(dev);
3475 break; 3482 goto out;
3476 } 3483 }
3477 } 3484 }
3478 } 3485 }
3486
3487 sky2_idle_start(hw);
3479out: 3488out:
3480 return err; 3489 return err;
3481} 3490}