Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44ade178249fe53d055fd92113eaa271e06acddd
Commit:     44ade178249fe53d055fd92113eaa271e06acddd
Parent:     25d82d7a2fc20cc4be414d738139594dc0adf179
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 20 13:06:34 2006 -0800
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Dec 26 16:36:42 2006 -0500

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/sky2.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 4fb3db9..93cb393 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3638,6 +3638,29 @@ static int sky2_resume(struct pci_dev *pdev)
 out:
        return err;
 }
+
+/* BIOS resume runs after device (it's a bug in PM)
+ * as a temporary workaround on suspend/resume leave MSI disabled
+ */
+static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state)
+{
+       struct sky2_hw *hw = pci_get_drvdata(pdev);
+
+       free_irq(pdev->irq, hw);
+       if (hw->msi) {
+               pci_disable_msi(pdev);
+               hw->msi = 0;
+       }
+       return 0;
+}
+
+static int sky2_resume_early(struct pci_dev *pdev)
+{
+       struct sky2_hw *hw = pci_get_drvdata(pdev);
+       struct net_device *dev = hw->dev[0];
+
+       return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw);
+}
 #endif
 
 static struct pci_driver sky2_driver = {
@@ -3648,6 +3671,8 @@ static struct pci_driver sky2_driver = {
 #ifdef CONFIG_PM
        .suspend = sky2_suspend,
        .resume = sky2_resume,
+       .suspend_late = sky2_suspend_late,
+       .resume_early = sky2_resume_early,
 #endif
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to