History

[PATCH] sky2: stop/start hardware idle timer on suspend/resume

The resume bug was caused not by an early interrupt but because the idle timeout was not being stopped on suspend. Also disable hardware IRQ's on suspend. Will need to revisit this with hotplug?

Stephen Hemminger committed 20 years ago

Commit eb35cf61 parent 8ab8fca1 file · +13 −4Browse files

Unified · Split

drivers/net/sky2.c+13−4
@@ -2161,6 +2161,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port, · 2160 unmodified lines
2161/* If idle then force a fake soft NAPI poll once a second2161/* 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, · 1183 unmodified lines
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) · 71 unmodified lines
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) · 36 unmodified lines
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}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t