diff mbox

bnx2: reset_task is crashing the kernel. Fixing it.

Message ID 1260990759-16236-1-git-send-email-leitao@linux.vnet.ibm.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Breno Leitao Dec. 16, 2009, 7:12 p.m. UTC
If bnx2 schedules a reset via the reset_task, e.g., due to a TX
timeout, it's possible for the NIC to be disabled with packets
pending for transmit.  In this case, napi_disable will loop forever,
eventually crashing the kernel.  This patch moves the disable of
the device to after the napi_disable call.

Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
---
 drivers/net/bnx2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Michael Chan Dec. 16, 2009, 7:15 p.m. UTC | #1
On Wed, 2009-12-16 at 11:12 -0800, leitao@linux.vnet.ibm.com wrote:
> If bnx2 schedules a reset via the reset_task, e.g., due to a TX
> timeout, it's possible for the NIC to be disabled with packets
> pending for transmit.  In this case, napi_disable will loop forever,
> eventually crashing the kernel.  This patch moves the disable of
> the device to after the napi_disable call.
> 
> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>

Acked-by: Michael Chan <mchan@broadcom.com>

> ---
>  drivers/net/bnx2.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index f81f082..65df1de 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -653,7 +653,6 @@ static void
>  bnx2_netif_stop(struct bnx2 *bp)
>  {
>  	bnx2_cnic_stop(bp);
> -	bnx2_disable_int_sync(bp);
>  	if (netif_running(bp->dev)) {
>  		int i;
>  
> @@ -667,6 +666,7 @@ bnx2_netif_stop(struct bnx2 *bp)
>  			txq->trans_start = jiffies;
>  		}
>  	}
> +	bnx2_disable_int_sync(bp);
>  }
>  
>  static void


--
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
David Miller Dec. 19, 2009, 4:29 a.m. UTC | #2
From: "Michael Chan" <mchan@broadcom.com>
Date: Wed, 16 Dec 2009 11:15:09 -0800

> 
> On Wed, 2009-12-16 at 11:12 -0800, leitao@linux.vnet.ibm.com wrote:
>> If bnx2 schedules a reset via the reset_task, e.g., due to a TX
>> timeout, it's possible for the NIC to be disabled with packets
>> pending for transmit.  In this case, napi_disable will loop forever,
>> eventually crashing the kernel.  This patch moves the disable of
>> the device to after the napi_disable call.
>> 
>> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
> 
> Acked-by: Michael Chan <mchan@broadcom.com>

Applied, thanks.
--
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

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f81f082..65df1de 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -653,7 +653,6 @@  static void
 bnx2_netif_stop(struct bnx2 *bp)
 {
 	bnx2_cnic_stop(bp);
-	bnx2_disable_int_sync(bp);
 	if (netif_running(bp->dev)) {
 		int i;
 
@@ -667,6 +666,7 @@  bnx2_netif_stop(struct bnx2 *bp)
 			txq->trans_start = jiffies;
 		}
 	}
+	bnx2_disable_int_sync(bp);
 }
 
 static void