diff mbox

bnx2: reset_task is crashing the kernel. Fixing it.

Message ID 1260965365-14255-3-git-send-email-leitao@linux.vnet.ibm.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Breno Leitao Dec. 16, 2009, 12:09 p.m. UTC
Acutally if a BNX2 interface gets time outs, the reset_task is
called to restart the interface. But, the NIC is turned off with
some packages to transmitt, and this causes the function
napi_disable() to loop forever, crashing the kernel.

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

Comments

laurent chavey Dec. 16, 2009, 5:23 p.m. UTC | #1
On Wed, Dec 16, 2009 at 4:09 AM,  <leitao@linux.vnet.ibm.com> wrote:
> Acutally if a BNX2 interface gets time outs, the reset_task is
> called to restart the interface. But, the NIC is turned off with
> some packages to transmitt, and this causes the function

s/packages/packets/
s/transmitt/transmit/

> napi_disable() to loop forever, crashing the kernel.
>
> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
> ---
>  drivers/net/bnx2.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index f81f082..40c883b 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -652,8 +652,6 @@ bnx2_napi_enable(struct bnx2 *bp)
>  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 +665,8 @@ bnx2_netif_stop(struct bnx2 *bp)
>                        txq->trans_start = jiffies;
>                }
>        }
> +       bnx2_cnic_stop(bp);
> +       bnx2_disable_int_sync(bp);
>  }
>
>  static void
> --
> 1.6.0.2
>
> --
> 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
>
--
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
Michael Chan Dec. 16, 2009, 6:40 p.m. UTC | #2
On Wed, 2009-12-16 at 04:09 -0800, leitao@linux.vnet.ibm.com wrote:
> Acutally if a BNX2 interface gets time outs, the reset_task is
> called to restart the interface. But, the NIC is turned off with
> some packages to transmitt, and this causes the function
> napi_disable() to loop forever, crashing the kernel.
> 
> Signed-off-by: Breno Leitao <leitao@linux.vnet.ibm.com>
> ---
>  drivers/net/bnx2.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
> index f81f082..40c883b 100644
> --- a/drivers/net/bnx2.c
> +++ b/drivers/net/bnx2.c
> @@ -652,8 +652,6 @@ bnx2_napi_enable(struct bnx2 *bp)
>  static void
>  bnx2_netif_stop(struct bnx2 *bp)
>  {
> -	bnx2_cnic_stop(bp);

bnx2_cnic_stop() needs to be done before NAPI is disabled because we
still need to service events in NAPI while stopping cnic.  So we need to
keep the call here.

> -	bnx2_disable_int_sync(bp);
>  	if (netif_running(bp->dev)) {
>  		int i;
>  
> @@ -667,6 +665,8 @@ bnx2_netif_stop(struct bnx2 *bp)
>  			txq->trans_start = jiffies;
>  		}
>  	}
> +	bnx2_cnic_stop(bp);
> +	bnx2_disable_int_sync(bp);

Moving bnx2_disable_int_sync() here looks ok.  Thanks.

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

Patch

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f81f082..40c883b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -652,8 +652,6 @@  bnx2_napi_enable(struct bnx2 *bp)
 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 +665,8 @@  bnx2_netif_stop(struct bnx2 *bp)
 			txq->trans_start = jiffies;
 		}
 	}
+	bnx2_cnic_stop(bp);
+	bnx2_disable_int_sync(bp);
 }
 
 static void