netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] via-rhine: suspend/resume bugfix
@ 2008-04-27  7:13 Ondrej Zajicek
  2008-04-27  8:59 ` Jiri Slaby
  0 siblings, 1 reply; 5+ messages in thread
From: Ondrej Zajicek @ 2008-04-27  7:13 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, netdev, rl

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 */
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] via-rhine: suspend/resume bugfix
  2008-04-27  7:13 [PATCH] via-rhine: suspend/resume bugfix Ondrej Zajicek
@ 2008-04-27  8:59 ` Jiri Slaby
  2008-04-27  9:58   ` Ondrej Zajicek
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Slaby @ 2008-04-27  8:59 UTC (permalink / raw)
  To: Ondrej Zajicek; +Cc: akpm, linux-kernel, netdev, rl

On 04/27/2008 09:13 AM, Ondrej Zajicek wrote:
> 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 */

What about PCI posting?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] via-rhine: suspend/resume bugfix
  2008-04-27  8:59 ` Jiri Slaby
@ 2008-04-27  9:58   ` Ondrej Zajicek
  2008-05-02 20:32     ` Pavel Machek
  0 siblings, 1 reply; 5+ messages in thread
From: Ondrej Zajicek @ 2008-04-27  9:58 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: akpm, linux-kernel, netdev, rl

On Sun, Apr 27, 2008 at 10:59:23AM +0200, Jiri Slaby wrote:
> >+	/* Disable interrupts by clearing the interrupt mask. */
> >+	iowrite16(0x0000, ioaddr + IntrEnable);
> >+
> >+	/* Stop the chip's Tx and Rx processes. */
> >+	iowrite16(CmdStop, ioaddr + ChipCmd);

> What about PCI posting?

Hmm, i will fix it. And i found that the patch might break
wakeup-on-LAN. So please discard it.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] via-rhine: suspend/resume bugfix
  2008-04-27  9:58   ` Ondrej Zajicek
@ 2008-05-02 20:32     ` Pavel Machek
  2008-05-02 20:57       ` Ondrej Zajicek
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2008-05-02 20:32 UTC (permalink / raw)
  To: Ondrej Zajicek; +Cc: Jiri Slaby, akpm, linux-kernel, netdev, rl

On Sun 2008-04-27 11:58:44, Ondrej Zajicek wrote:
> On Sun, Apr 27, 2008 at 10:59:23AM +0200, Jiri Slaby wrote:
> > >+	/* Disable interrupts by clearing the interrupt mask. */
> > >+	iowrite16(0x0000, ioaddr + IntrEnable);
> > >+
> > >+	/* Stop the chip's Tx and Rx processes. */
> > >+	iowrite16(CmdStop, ioaddr + ChipCmd);
> 
> > What about PCI posting?
> 
> Hmm, i will fix it. And i found that the patch might break
> wakeup-on-LAN. So please discard it.

IRQ line should not be neccessary for WoL...?

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] via-rhine: suspend/resume bugfix
  2008-05-02 20:32     ` Pavel Machek
@ 2008-05-02 20:57       ` Ondrej Zajicek
  0 siblings, 0 replies; 5+ messages in thread
From: Ondrej Zajicek @ 2008-05-02 20:57 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Ondrej Zajicek, Jiri Slaby, akpm, linux-kernel, netdev, rl

On Fri, May 02, 2008 at 10:32:46PM +0200, Pavel Machek wrote:
> > Hmm, i will fix it. And i found that the patch might break
> > wakeup-on-LAN. So please discard it.
> 
> IRQ line should not be neccessary for WoL...?

IRQ line is not neccessary (i hope), but the patch puts this to
suspend path:

/* 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);

(this was copied from shutdown path of the driver)

I suppose that the first one might break WoL. Unfortunately
on my hardware the WoL don't work even without the patch.

-- 
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-02 21:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-27  7:13 [PATCH] via-rhine: suspend/resume bugfix Ondrej Zajicek
2008-04-27  8:59 ` Jiri Slaby
2008-04-27  9:58   ` Ondrej Zajicek
2008-05-02 20:32     ` Pavel Machek
2008-05-02 20:57       ` Ondrej Zajicek

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).