netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix b44 RX FIFO overflow recovery.
@ 2010-06-30 20:11 James Courtier-Dutton
  2010-06-30 20:25 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: James Courtier-Dutton @ 2010-06-30 20:11 UTC (permalink / raw)
  To: netdev

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

Hi,

This patch improves the recovery after a RX FIFO overflow on the b44
Ethernet NIC.
Before it would do a complete chip reset, resulting is loss of link
for a few seconds.
This patch improves this to do recovery in about 20ms without loss of link.

Kind Regards

James

b44: Handle RX FIFO overflow better.
Signed off by: James@superbug.co.uk

[-- Attachment #2: b44-fix-rx-overflow.txt --]
[-- Type: text/plain, Size: 1363 bytes --]

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 69d9f3d..72537c1 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -852,12 +852,46 @@ static int b44_poll(struct napi_struct *napi, int budget)
 		/* spin_unlock(&bp->tx_lock); */
 	}
 	spin_unlock_irqrestore(&bp->lock, flags);
+	if (bp->istat & ISTAT_DSCE)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_DSCE\n");
+	}
+	if (bp->istat & ISTAT_DATAE)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_DATAE\n");
+	}
+	if (bp->istat & ISTAT_DPE)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_DPE\n");
+	}
+	if (bp->istat & ISTAT_RDU)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_RDU\n");
+	}
+	if (bp->istat & ISTAT_RFO)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_RFO\n");
+		spin_lock_irqsave(&bp->lock, flags);
+		b44_disable_ints(bp);
+		/* This resets the ISTAT_RFO flag */
+		ssb_device_enable(bp->sdev, 0);
+		b44_init_rings(bp);
+		b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY);
+		netif_wake_queue(bp->dev);
+		spin_unlock_irqrestore(&bp->lock, flags);
+		work_done = 0;
+	}
+	if (bp->istat & ISTAT_TFU)
+	{
+		printk(KERN_INFO "b44_poll: ISTAT_TFU\n");
+	}
+
 
 	work_done = 0;
 	if (bp->istat & ISTAT_RX)
 		work_done += b44_rx(bp, budget);
 
-	if (bp->istat & ISTAT_ERRORS) {
+	if ((bp->istat & ISTAT_ERRORS) && !(bp->istat & ISTAT_RFO)) {
 		spin_lock_irqsave(&bp->lock, flags);
 		b44_halt(bp);
 		b44_init_rings(bp);

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

* Re: [PATCH] Fix b44 RX FIFO overflow recovery.
  2010-06-30 20:11 [PATCH] Fix b44 RX FIFO overflow recovery James Courtier-Dutton
@ 2010-06-30 20:25 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-06-30 20:25 UTC (permalink / raw)
  To: james.dutton; +Cc: netdev

From: James Courtier-Dutton <james.dutton@gmail.com>
Date: Wed, 30 Jun 2010 21:11:18 +0100

> diff --git a/drivers/net/b44.c b/drivers/net/b44.c
> index 69d9f3d..72537c1 100644
> --- a/drivers/net/b44.c
> +++ b/drivers/net/b44.c
> @@ -852,12 +852,46 @@ static int b44_poll(struct napi_struct *napi, int budget)
>  		/* spin_unlock(&bp->tx_lock); */
>  	}
>  	spin_unlock_irqrestore(&bp->lock, flags);
> +	if (bp->istat & ISTAT_DSCE)
> +	{
> +		printk(KERN_INFO "b44_poll: ISTAT_DSCE\n");
> +	}

Using braces here is overkill, and even if it was appropriate it's formatted
incorrectly, it should be:

	if (x)
		y;

for single-line code blocks, and:

	if (x) {
		y;
		z;
	}

For multi-line code blocks.

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

end of thread, other threads:[~2010-06-30 20:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-30 20:11 [PATCH] Fix b44 RX FIFO overflow recovery James Courtier-Dutton
2010-06-30 20:25 ` David Miller

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