netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.33] net: Fix ks8851 snl receive problem
@ 2009-12-21 21:29 Ha, Tristram
  2009-12-22  0:49 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Ha, Tristram @ 2009-12-21 21:29 UTC (permalink / raw)
  To: Ben Dooks; +Cc: netdev, linux-kernel

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>
---
This patch has some relations to two previous patches I submitted: "[PATH 2.6.32 2/3] net: Fix ks8851 snl transmit problem" and "[PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board."  Please see my replies regarding those patches.

--- linux-2.6.33-rc1.old/drivers/net/ks8851.c	2009-12-08 17:46:20.000000000 -0800
+++ linux-2.6.33-rc1.new/drivers/net/ks8851.c	2009-12-21 10:43:43.000000000 -0800
@@ -551,6 +551,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))
@@ -621,6 +628,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);
 
 	if (status & IRQ_TXI)

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

* Re: [PATCH 2.6.33] net: Fix ks8851 snl receive problem
  2009-12-21 21:29 [PATCH 2.6.33] net: Fix ks8851 snl receive problem Ha, Tristram
@ 2009-12-22  0:49 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2009-12-22  0:49 UTC (permalink / raw)
  To: Ha, Tristram; +Cc: Ben Dooks, netdev, linux-kernel

On Mon, 21 Dec 2009 13:29:42 -0800
"Ha, Tristram" <Tristram.Ha@Micrel.Com> wrote:

> 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>
> ---
> This patch has some relations to two previous patches I submitted: "[PATH 2.6.32 2/3] net: Fix ks8851 snl transmit problem" and "[PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board."  Please see my replies regarding those patches.
> 
> --- linux-2.6.33-rc1.old/drivers/net/ks8851.c	2009-12-08 17:46:20.000000000 -0800
> +++ linux-2.6.33-rc1.new/drivers/net/ks8851.c	2009-12-21 10:43:43.000000000 -0800
> @@ -551,6 +551,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))
> @@ -621,6 +628,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);
>  
>  	if (status & IRQ_TXI)

If you can turn off the receive interupt you can probably implement
NAPI, to do proper receive scheduling.

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

end of thread, other threads:[~2009-12-22  0:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-21 21:29 [PATCH 2.6.33] net: Fix ks8851 snl receive problem Ha, Tristram
2009-12-22  0:49 ` Stephen Hemminger

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