netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: netdev@vger.kernel.org
Subject: [patch 2/6] sky2: power management/MSI workaround
Date: Wed, 20 Dec 2006 13:06:34 -0800	[thread overview]
Message-ID: <20061220210922.806777269@osdl.org> (raw)
In-Reply-To: 20061220210632.183204605@osdl.org

[-- Attachment #1: sky2-msi-resume.patch --]
[-- Type: text/plain, Size: 1504 bytes --]

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>

--- sky2-2.6.orig/drivers/net/sky2.c	2006-12-18 14:22:56.000000000 -0800
+++ sky2-2.6/drivers/net/sky2.c	2006-12-18 14:31:43.000000000 -0800
@@ -3638,6 +3638,29 @@
 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 @@
 #ifdef CONFIG_PM
 	.suspend = sky2_suspend,
 	.resume = sky2_resume,
+	.suspend_late = sky2_suspend_late,
+	.resume_early = sky2_resume_early,
 #endif
 };
 

--
Stephen Hemminger <shemminger@osdl.org>


  parent reply	other threads:[~2006-12-22  0:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 21:06 [patch 0/6] sky2 driver update (v1.11) Stephen Hemminger
2006-12-20 21:06 ` [patch 1/6] sky2: dual port NAPI problem Stephen Hemminger
2006-12-26 21:36   ` Jeff Garzik
2006-12-20 21:06 ` Stephen Hemminger [this message]
2006-12-20 21:06 ` [patch 3/6] sky2: phy power down needs PCI config write enabled Stephen Hemminger
2006-12-20 21:06 ` [patch 4/6] sky2: better power state management Stephen Hemminger
2006-12-26 21:37   ` Jeff Garzik
2006-12-20 21:06 ` [patch 5/6] sky2: add Wake On Lan support Stephen Hemminger
2006-12-20 21:06 ` [patch 6/6] sky2: version 1.11 Stephen Hemminger
2006-12-26 21:44 ` [patch 0/6] sky2 driver update (v1.11) Jeff Garzik
2007-01-01 18:36   ` Stephen Hemminger
2007-01-02 19:10     ` Tino Keitel
2007-01-13 13:03       ` Tino Keitel
2007-01-15 18:21         ` Stephen Hemminger
2007-01-15 19:12           ` Tino Keitel
2007-01-02 21:52     ` Gerd v. Egidy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061220210922.806777269@osdl.org \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).