public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Ayaz Abdulla <aabdulla@nvidia•com>
To: Jeff Garzik <jgarzik@pobox•com>,
	Manfred Spraul <manfred@colorfullife•com>,
	"David S. Miller" <davem@davemloft•net>,
	Andrew Morton <akpm@osdl•org>, nedev <netdev@vger•kernel.org>
Subject: [PATCH 4/5] forcedeth: recover error support
Date: Fri, 30 Jan 2009 13:56:38 -0500	[thread overview]
Message-ID: <49834D66.4070406@nvidia.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 213 bytes --]

This patch adds another type of recoverable error to the driver. It also 
modifies the sequence for recovery to include a mac reset and clearing 
of interrupts.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia•com>


[-- Attachment #2: patch-forcedeth-recover-error --]
[-- Type: text/plain, Size: 1674 bytes --]

--- old/drivers/net/forcedeth.c	2009-01-28 12:42:58.000000000 -0800
+++ new/drivers/net/forcedeth.c	2009-01-28 12:44:18.000000000 -0800
@@ -102,7 +102,7 @@
 enum {
 	NvRegIrqStatus = 0x000,
 #define NVREG_IRQSTAT_MIIEVENT	0x040
-#define NVREG_IRQSTAT_MASK		0x81ff
+#define NVREG_IRQSTAT_MASK		0x83ff
 	NvRegIrqMask = 0x004,
 #define NVREG_IRQ_RX_ERROR		0x0001
 #define NVREG_IRQ_RX			0x0002
@@ -113,7 +113,7 @@
 #define NVREG_IRQ_LINK			0x0040
 #define NVREG_IRQ_RX_FORCED		0x0080
 #define NVREG_IRQ_TX_FORCED		0x0100
-#define NVREG_IRQ_RECOVER_ERROR		0x8000
+#define NVREG_IRQ_RECOVER_ERROR		0x8200
 #define NVREG_IRQMASK_THROUGHPUT	0x00df
 #define NVREG_IRQMASK_CPU		0x0060
 #define NVREG_IRQ_TX_ALL		(NVREG_IRQ_TX_ERR|NVREG_IRQ_TX_OK|NVREG_IRQ_TX_FORCED)
@@ -4064,13 +4064,15 @@
 
 	if (np->recover_error) {
 		np->recover_error = 0;
-		printk(KERN_INFO "forcedeth: MAC in recoverable error state\n");
+		printk(KERN_INFO "%s: MAC in recoverable error state\n", dev->name);
 		if (netif_running(dev)) {
 			netif_tx_lock_bh(dev);
 			netif_addr_lock(dev);
 			spin_lock(&np->lock);
 			/* stop engines */
 			nv_stop_rxtx(dev);
+			if (np->driver_data & DEV_HAS_POWER_CNTRL)
+				nv_mac_reset(dev);
 			nv_txrx_reset(dev);
 			/* drain rx queue */
 			nv_drain_rxtx(dev);
@@ -4088,6 +4090,11 @@
 			pci_push(base);
 			writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
 			pci_push(base);
+			/* clear interrupts */
+			if (!(np->msi_flags & NV_MSI_X_ENABLED))
+				writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
+			else
+				writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus);
 
 			/* restart rx engine */
 			nv_start_rxtx(dev);

             reply	other threads:[~2009-01-30 22:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-30 18:56 Ayaz Abdulla [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-06 19:27 [PATCH 4/5] forcedeth: recover error support Ayaz Abdulla
2009-02-07  8:26 ` David Miller

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=49834D66.4070406@nvidia.com \
    --to=aabdulla@nvidia$(echo .)com \
    --cc=akpm@osdl$(echo .)org \
    --cc=davem@davemloft$(echo .)net \
    --cc=jgarzik@pobox$(echo .)com \
    --cc=manfred@colorfullife$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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