Patchwork [2/7,v2] GRETH: fix opening/closing

login
register
mail settings
Submitter Daniel Hellstrom
Date Jan. 14, 2011, 1:02 p.m.
Message ID <1295010163-2585-2-git-send-email-daniel@gaisler.com>
Download mbox | patch
Permalink /patch/78892/
State Accepted
Delegated to: David Miller
Headers show

Comments

Daniel Hellstrom - Jan. 14, 2011, 1:02 p.m.
When NAPI is disabled there is no point in having IRQs enabled, TX/RX
should be off before clearing the TX/RX descriptor rings.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
 drivers/net/greth.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
David Miller - Jan. 14, 2011, 8:46 p.m.
From: Daniel Hellstrom <daniel@gaisler.com>
Date: Fri, 14 Jan 2011 14:02:38 +0100

> When NAPI is disabled there is no point in having IRQs enabled, TX/RX
> should be off before clearing the TX/RX descriptor rings.
> 
> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index 1c2dbdb..b307696 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -356,6 +356,8 @@  static int greth_open(struct net_device *dev)
 		dev_dbg(&dev->dev, " starting queue\n");
 	netif_start_queue(dev);
 
+	GRETH_REGSAVE(greth->regs->status, 0xFF);
+
 	napi_enable(&greth->napi);
 
 	greth_enable_irqs(greth);
@@ -371,7 +373,9 @@  static int greth_close(struct net_device *dev)
 
 	napi_disable(&greth->napi);
 
+	greth_disable_irqs(greth);
 	greth_disable_tx(greth);
+	greth_disable_rx(greth);
 
 	netif_stop_queue(dev);