From patchwork Wed Dec 16 19:12:39 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Breno Leitao X-Patchwork-Id: 41283 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 37039B6F05 for ; Thu, 17 Dec 2009 06:14:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762968AbZLPTNg (ORCPT ); Wed, 16 Dec 2009 14:13:36 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762913AbZLPTN3 (ORCPT ); Wed, 16 Dec 2009 14:13:29 -0500 Received: from e24smtp05.br.ibm.com ([32.104.18.26]:46461 "EHLO e24smtp05.br.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762968AbZLPTN1 (ORCPT ); Wed, 16 Dec 2009 14:13:27 -0500 Received: from mailhub3.br.ibm.com (mailhub3.br.ibm.com [9.18.232.110]) by e24smtp05.br.ibm.com (8.14.3/8.13.1) with ESMTP id nBGJ4wF2026517 for ; Wed, 16 Dec 2009 17:04:58 -0200 Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nBGJF8ek1421378 for ; Wed, 16 Dec 2009 17:15:09 -0200 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nBGJDNc4028651 for ; Wed, 16 Dec 2009 17:13:23 -0200 Received: from localhost.localdomain (js22-stormy-13.austin.ibm.com [9.3.232.117]) by d24av04.br.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nBGJDMBQ028614; Wed, 16 Dec 2009 17:13:22 -0200 From: leitao@linux.vnet.ibm.com To: mchan@broadcom.com Cc: netdev@vger.kernel.org, Breno Leitao Subject: [PATCH] bnx2: reset_task is crashing the kernel. Fixing it. Date: Wed, 16 Dec 2009 13:12:39 -0600 Message-Id: <1260990759-16236-1-git-send-email-leitao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1260988830.31045.79.camel@nseg_linux_HP1.broadcom.com> References: <1260988830.31045.79.camel@nseg_linux_HP1.broadcom.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Acked-by: Michael Chan --- 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