[PATCH] via-rhine: suspend/resume bugfix

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ondrej Zajicek
Date: Sunday, April 27, 2008 - 12:13 am

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 */
 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] via-rhine: suspend/resume bugfix, Ondrej Zajicek, (Sun Apr 27, 12:13 am)
Re: [PATCH] via-rhine: suspend/resume bugfix, Jiri Slaby, (Sun Apr 27, 1:59 am)
Re: [PATCH] via-rhine: suspend/resume bugfix, Ondrej Zajicek, (Sun Apr 27, 2:58 am)
Re: [PATCH] via-rhine: suspend/resume bugfix, Pavel Machek, (Fri May 2, 1:32 pm)
Re: [PATCH] via-rhine: suspend/resume bugfix, Ondrej Zajicek, (Fri May 2, 1:57 pm)