netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: linus@osdl.org, netdev@vger.kernel.org
Subject: [RFT 5/5] sky2: suspend/resume patchlets
Date: Tue, 13 Jun 2006 17:17:31 +0900	[thread overview]
Message-ID: <20060613081930.968244000@localhost.localdomain> (raw)
In-Reply-To: 20060613081726.695812000@localhost.localdomain

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

Subject: [RFT 5/5] sky2: stop/start hardware idle timer on suspend/resume

The resume bug was cause 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?

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- test.orig/drivers/net/sky2.c
+++ test/drivers/net/sky2.c
@@ -2161,6 +2161,13 @@ static void sky2_descriptor_error(struct
 /* If idle then force a fake soft NAPI poll once a second
  * to work around cases where sharing an edge triggered interrupt.
  */
+static inline void sky2_idle_start(struct sky2_hw *hw)
+{
+	if (idle_timeout > 0)
+		mod_timer(&hw->idle_timer,
+			  jiffies + msecs_to_jiffies(idle_timeout));
+}
+
 static void sky2_idle(unsigned long arg)
 {
 	struct sky2_hw *hw = (struct sky2_hw *) arg;
@@ -3350,9 +3357,7 @@ static int __devinit sky2_probe(struct p
 	sky2_write32(hw, B0_IMSK, Y2_IS_BASE);
 
 	setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw);
-	if (idle_timeout > 0)
-		mod_timer(&hw->idle_timer,
-			  jiffies + msecs_to_jiffies(idle_timeout));
+	sky2_idle_start(hw);
 
 	pci_set_drvdata(pdev, hw);
 
@@ -3430,6 +3435,8 @@ static int sky2_suspend(struct pci_dev *
 	if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
 		return -EINVAL;
 
+	del_timer_sync(&hw->idle_timer);
+
 	for (i = 0; i < hw->ports; i++) {
 		struct net_device *dev = hw->dev[i];
 
@@ -3472,10 +3479,12 @@ static int sky2_resume(struct pci_dev *p
 				printk(KERN_ERR PFX "%s: could not up: %d\n",
 				       dev->name, err);
 				dev_close(dev);
-				break;
+				goto out;
 			}
 		}
 	}
+
+	sky2_idle_start(hw);
 out:
 	return err;
 }

--


  parent reply	other threads:[~2006-06-13  8:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-13  8:17 [RFT 0/5] sky2: suspend/resume patchlets Stephen Hemminger
2006-06-13  8:17 ` [RFT 1/5] " Stephen Hemminger
2006-06-13  8:17 ` [RFT 2/5] " Stephen Hemminger
2006-06-13  8:17 ` [RFT 3/5] " Stephen Hemminger
2006-06-13  8:17 ` [RFT 4/5] " Stephen Hemminger
2006-06-13  8:17 ` Stephen Hemminger [this message]
2006-06-13 13:22 ` [RFT 0/5] " Jeff Garzik
2006-06-13 16:38 ` Linus Torvalds

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=20060613081930.968244000@localhost.localdomain \
    --to=shemminger@osdl.org \
    --cc=jgarzik@pobox.com \
    --cc=linus@osdl.org \
    --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).