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?
Unified · Split
| @@ -2161,6 +2161,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port, · 2160 unmodified lines | ||
| 2161 | 2161 | /* If idle then force a fake soft NAPI poll once a second |
| 2162 | 2162 | * to work around cases where sharing an edge triggered interrupt. |
| 2163 | 2163 | */ |
| 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 | + | |
| 2164 | 2171 | static void sky2_idle(unsigned long arg) |
| 2165 | 2172 | { |
| 2166 | 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 | 3357 | sky2_write32(hw, B0_IMSK, Y2_IS_BASE); |
| 3351 | 3358 | |
| 3352 | 3359 | 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); | |
| 3356 | 3361 | |
| 3357 | 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 | 3435 | if (!(pstate == PCI_D3hot || pstate == PCI_D3cold)) |
| 3431 | 3436 | return -EINVAL; |
| 3432 | 3437 | |
| 3438 | + del_timer_sync(&hw->idle_timer); | |
| 3439 | + | |
| 3433 | 3440 | for (i = 0; i < hw->ports; i++) { |
| 3434 | 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 | 3479 | printk(KERN_ERR PFX "%s: could not up: %d\n", |
| 3473 | 3480 | dev->name, err); |
| 3474 | 3481 | dev_close(dev); |
| 3475 | − break; | |
| 3482 | + goto out; | |
| 3476 | 3483 | } |
| 3477 | 3484 | } |
| 3478 | 3485 | } |
| 3486 | + | |
| 3487 | + sky2_idle_start(hw); | |
| 3479 | 3488 | out: |
| 3480 | 3489 | return err; |
| 3481 | 3490 | } |