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
21612161 /* If idle then force a fake soft NAPI poll once a second
21622162 * to work around cases where sharing an edge triggered interrupt.
21632163 */
2164+static 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+
21642171 static void sky2_idle(unsigned long arg)
21652172 {
21662173 struct sky2_hw *hw = (struct sky2_hw *) arg;
@@ -3350,9 +3357,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, · 1183 unmodified lines
33503357 sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
33513358
33523359 setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
3353− if (idle_timeout > 0)
3354− mod_timer(&hw->idle_timer,
3355− jiffies + msecs_to_jiffies(idle_timeout));
3360+ sky2_idle_start(hw);
33563361
33573362 pci_set_drvdata(pdev, hw);
33583363
@@ -3430,6 +3435,8 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) · 71 unmodified lines
34303435 if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
34313436 return -EINVAL;
34323437
3438+ del_timer_sync(&hw->idle_timer);
3439+
34333440 for (i = 0; i < hw->ports; i++) {
34343441 struct net_device *dev = hw->dev[i];
34353442
@@ -3472,10 +3479,12 @@ static int sky2_resume(struct pci_dev *pdev) · 36 unmodified lines
34723479 printk(KERN_ERR PFX "%s: could not up: %d\n",
34733480 dev->name, err);
34743481 dev_close(dev);
3475− break;
3482+ goto out;
34763483 }
34773484 }
34783485 }
3486+
3487+ sky2_idle_start(hw);
34793488 out:
34803489 return err;
34813490 }

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