aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-12-20 16:06:34 -0500
committerJeff Garzik <jeff@garzik.org>2006-12-26 16:36:42 -0500
commit44ade178249fe53d055fd92113eaa271e06acddd (patch)
tree1b30df83af43394744ed51ce60f0eabdbd56500a
parent25d82d7a2fc20cc4be414d738139594dc0adf179 (diff)
sky2: power management/MSI workaround
MSI doesn't work properly on resume on many platforms because the BIOS goes and changes it back to INTx mode after the sky2 driver has restored in resume. It is really a bug in the base power management resume code, and this workaround is temporary until the change to PM code works it's way through the release process. The PM fix is non-trivial since it needs to change when non-boot CPU's are enabled. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r--drivers/net/sky2.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 4fb3db99bcd1..93cb39388a1b 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3638,6 +3638,29 @@ static int sky2_resume(struct pci_dev *pdev)
3638out: 3638out:
3639 return err; 3639 return err;
3640} 3640}
3641
3642/* BIOS resume runs after device (it's a bug in PM)
3643 * as a temporary workaround on suspend/resume leave MSI disabled
3644 */
3645static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state)
3646{
3647 struct sky2_hw *hw = pci_get_drvdata(pdev);
3648
3649 free_irq(pdev->irq, hw);
3650 if (hw->msi) {
3651 pci_disable_msi(pdev);
3652 hw->msi = 0;
3653 }
3654 return 0;
3655}
3656
3657static int sky2_resume_early(struct pci_dev *pdev)
3658{
3659 struct sky2_hw *hw = pci_get_drvdata(pdev);
3660 struct net_device *dev = hw->dev[0];
3661
3662 return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw);
3663}
3641#endif 3664#endif
3642 3665
3643static struct pci_driver sky2_driver = { 3666static struct pci_driver sky2_driver = {
@@ -3648,6 +3671,8 @@ static struct pci_driver sky2_driver = {
3648#ifdef CONFIG_PM 3671#ifdef CONFIG_PM
3649 .suspend = sky2_suspend, 3672 .suspend = sky2_suspend,
3650 .resume = sky2_resume, 3673 .resume = sky2_resume,
3674 .suspend_late = sky2_suspend_late,
3675 .resume_early = sky2_resume_early,
3651#endif 3676#endif
3652}; 3677};
3653 3678