netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] forcedeth: msi interrupts
@ 2008-06-03 20:51 Ayaz Abdulla
  2008-06-04 22:18 ` Andrew Morton
  2008-06-06 18:03 ` Ayaz Abdulla
  0 siblings, 2 replies; 15+ messages in thread
From: Ayaz Abdulla @ 2008-06-03 20:51 UTC (permalink / raw)
  To: Jeff Garzik, Manfred Spraul, Andrew Morton, nedev

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

This patch adds a workaround for lost MSI interrupts. There is a race 
condition in the HW in which future interrupts could be missed. The 
workaround is to toggle the MSI irq mask.

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


[-- Attachment #2: patch-forcedeth-msi-irq --]
[-- Type: text/plain, Size: 1317 bytes --]

--- old/drivers/net/forcedeth.c	2008-06-03 16:16:26.000000000 -0400
+++ new/drivers/net/forcedeth.c	2008-06-03 16:31:44.000000000 -0400
@@ -3277,6 +3277,20 @@
 	dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
 }
 
+static inline void nv_msi_workaround(struct net_device *dev)
+{
+	struct fe_priv *np = netdev_priv(dev);
+	u8 __iomem *base = get_hwbase(dev);
+
+	/* Need to toggle the msi irq mask within the ethernet device,
+	 * otherwise, future interrupts will not be detected.
+	 */
+	if (np->msi_flags & NV_MSI_ENABLED) {
+		writel(0, base + NvRegMSIIrqMask);
+		writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
+	}
+}
+
 static irqreturn_t nv_nic_irq(int foo, void *data)
 {
 	struct net_device *dev = (struct net_device *) data;
@@ -3299,6 +3313,8 @@
 		if (!(events & np->irqmask))
 			break;
 
+		nv_msi_workaround(dev);
+
 		spin_lock(&np->lock);
 		nv_tx_done(dev);
 		spin_unlock(&np->lock);
@@ -3414,6 +3430,8 @@
 		if (!(events & np->irqmask))
 			break;
 
+		nv_msi_workaround(dev);
+
 		spin_lock(&np->lock);
 		nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
 		spin_unlock(&np->lock);
@@ -3754,6 +3772,8 @@
 	if (!(events & NVREG_IRQ_TIMER))
 		return IRQ_RETVAL(0);
 
+	nv_msi_workaround(dev);
+
 	spin_lock(&np->lock);
 	np->intr_test = 1;
 	spin_unlock(&np->lock);

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

end of thread, other threads:[~2008-06-08  2:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-03 20:51 [PATCH] forcedeth: msi interrupts Ayaz Abdulla
2008-06-04 22:18 ` Andrew Morton
2008-06-04 23:00   ` Karen Shaeffer
2008-06-06 17:15   ` Ayaz Abdulla
2008-06-06 20:19     ` Andrew Morton
2008-06-06 18:04       ` Ayaz Abdulla
2008-06-06 21:10         ` Andrew Morton
2008-06-06 21:19           ` Ayaz Abdulla
2008-06-06 21:40             ` Karen Shaeffer
2008-06-07 18:31               ` Karen Shaeffer
2008-06-07 19:28                 ` Ayaz Abdulla
2008-06-08  1:33                   ` Karen Shaeffer
2008-06-08  2:01                     ` Karen Shaeffer
2008-06-07 19:24               ` Ayaz Abdulla
2008-06-06 18:03 ` Ayaz Abdulla

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