netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ondrej Zajicek <santiago@crfreenet.org>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, rl@hellgate.ch
Subject: [PATCH] via-rhine: suspend/resume bugfix
Date: Sun, 27 Apr 2008 09:13:51 +0200	[thread overview]
Message-ID: <20080427071351.GA20561@localhost.localdomain> (raw)

There is a bug in via-rhine driver - the driver don't disable
interrupts during suspend, which sometimes leads to globally
disabled interrupt line.

This patch disables interrupts (and Rx/Tx) during suspend.

Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org>

---

diff -uprN -X linux-2.6.25/Documentation/dontdiff linux-2.6.25/drivers/net/via-rhine.c linux-2.6.25-feanor/drivers/net/via-rhine.c
--- linux-2.6.25/drivers/net/via-rhine.c	2008-04-17 04:49:44.000000000 +0200
+++ linux-2.6.25-feanor/drivers/net/via-rhine.c	2008-04-26 14:08:44.000000000 +0200
@@ -1886,6 +1886,15 @@ static void rhine_shutdown (struct pci_d
 	struct rhine_private *rp = netdev_priv(dev);
 	void __iomem *ioaddr = rp->base;
 
+	/* Switch to loopback mode to avoid hardware races. */
+	iowrite8(rp->tx_thresh | 0x02, ioaddr + TxConfig);
+
+	/* Disable interrupts by clearing the interrupt mask. */
+	iowrite16(0x0000, ioaddr + IntrEnable);
+
+	/* Stop the chip's Tx and Rx processes. */
+	iowrite16(CmdStop, ioaddr + ChipCmd);
+
 	if (!(rp->quirks & rqWOL))
 		return; /* Nothing to do for non-WOL adapters */
 

             reply	other threads:[~2008-04-27  7:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27  7:13 Ondrej Zajicek [this message]
2008-04-27  8:59 ` [PATCH] via-rhine: suspend/resume bugfix Jiri Slaby
2008-04-27  9:58   ` Ondrej Zajicek
2008-05-02 20:32     ` Pavel Machek
2008-05-02 20:57       ` Ondrej Zajicek

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=20080427071351.GA20561@localhost.localdomain \
    --to=santiago@crfreenet.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rl@hellgate.ch \
    /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).