diff mbox

[02/13] KSZ8851-SNL: Fix receive interrupt problem.

Message ID 20100429231739.628756349@fluff.org.uk
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Ben Dooks April 29, 2010, 11:16 p.m. UTC
From: Tristram Ha <Tristram.Ha@micrel.com>

This fixes a receive problem of the ks8851 snl network driver.

Under heavy TCP traffic the device will stop operating correctly. First
the receive interrupt is not triggered anymore.  After then the driver
cannot retrieve the correct packets from the device.  A workaround for
this problem is to disable the transmit done interrupt.

Signed-off-by: Tristram Ha <Tristram.Ha@micrel.com>
[ben@simtec.co.uk: cleaned up header]
Signed-off-by: Ben Dooks <ben@simtec.co.uk>

---
---
 drivers/net/ks8851.c |   10 ++++++++++
 1 file changed, 10 insertions(+)


--
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
diff mbox

Patch

Index: b/drivers/net/ks8851.c
===================================================================
--- a/drivers/net/ks8851.c	2010-04-28 23:24:20.737026841 +0900
+++ b/drivers/net/ks8851.c	2010-04-29 00:51:12.489525834 +0900
@@ -553,6 +553,13 @@  static void ks8851_irq_work(struct work_
 
 	mutex_lock(&ks->lock);
 
+	/*
+	 * Turn off hardware interrupt during receive processing.  This fixes
+	 * the receive problem under heavy TCP traffic while transmit done
+	 * is enabled.
+	 */
+	ks8851_wrreg16(ks, KS_IER, 0);
+
 	status = ks8851_rdreg16(ks, KS_ISR);
 
 	if (netif_msg_intr(ks))
@@ -610,6 +617,9 @@  static void ks8851_irq_work(struct work_
 		ks8851_wrreg16(ks, KS_RXCR1, rxc->rxcr1);
 	}
 
+	/* Re-enable hardware interrupt. */
+	ks8851_wrreg16(ks, KS_IER, ks->rc_ier);
+
 	mutex_unlock(&ks->lock);
 
 	enable_irq(ks->netdev->irq);