From patchwork Thu Jun 30 20:02:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ron Mercer X-Patchwork-Id: 102828 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 6AFF6B6F18 for ; Fri, 1 Jul 2011 06:19:00 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751302Ab1F3USx (ORCPT ); Thu, 30 Jun 2011 16:18:53 -0400 Received: from ch1ehsobe004.messaging.microsoft.com ([216.32.181.184]:12067 "EHLO CH1EHSOBE017.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751097Ab1F3USw (ORCPT ); Thu, 30 Jun 2011 16:18:52 -0400 Received: from mail150-ch1-R.bigfish.com (216.32.181.172) by CH1EHSOBE017.bigfish.com (10.43.70.67) with Microsoft SMTP Server id 14.1.225.22; Thu, 30 Jun 2011 20:18:51 +0000 Received: from mail150-ch1 (localhost.localdomain [127.0.0.1]) by mail150-ch1-R.bigfish.com (Postfix) with ESMTP id AA67418480DC; Thu, 30 Jun 2011 20:18:51 +0000 (UTC) X-SpamScore: 0 X-BigFish: VPS0(zzzz1202hzz8275bhz2fh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:198.70.193.61; KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub1.qlogic.com; EFVD:NLI Received-SPF: pass (mail150-ch1: domain of qlogic.com designates 198.70.193.61 as permitted sender) client-ip=198.70.193.61; envelope-from=ron.mercer@qlogic.com; helo=avexcashub1.qlogic.com ; 1.qlogic.com ; Received: from mail150-ch1 (localhost.localdomain [127.0.0.1]) by mail150-ch1 (MessageSwitch) id 1309465131496873_23786; Thu, 30 Jun 2011 20:18:51 +0000 (UTC) Received: from CH1EHSMHS025.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.251]) by mail150-ch1.bigfish.com (Postfix) with ESMTP id 74330370050; Thu, 30 Jun 2011 20:18:51 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.61) by CH1EHSMHS025.bigfish.com (10.43.70.25) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 30 Jun 2011 20:18:50 +0000 Received: from linux-ox1b.qlogic.com (172.17.139.71) by avexcashub1.qlc.com (10.1.4.161) with Microsoft SMTP Server id 8.1.436.0; Thu, 30 Jun 2011 13:18:50 -0700 Received: by linux-ox1b.qlogic.com (Postfix, from userid 1000) id 1EF9E2C696; Thu, 30 Jun 2011 13:02:07 -0700 (PDT) From: Ron Mercer To: CC: , , , Subject: [net-2.6 PATCH 1/3] qlge:Fix crash caused by mailbox execution on wedged chip. Date: Thu, 30 Jun 2011 13:02:05 -0700 Message-ID: <1309464127-14797-1-git-send-email-ron.mercer@qlogic.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1308855049.6688.19.camel@Joe-Laptop> References: <1308855049.6688.19.camel@Joe-Laptop> MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jitendra Kalsaria When we are in a recover process from a chip fatal error, driver should skip over execution of mailbox commands during resetting chip. Signed-off-by: Jitendra Kalsaria Signed-off-by: Ron Mercer --- drivers/net/qlge/qlge.h | 1 + drivers/net/qlge/qlge_main.c | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index d328507..b2c8612 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h @@ -1996,6 +1996,7 @@ enum { QL_LB_LINK_UP = 10, QL_FRC_COREDUMP = 11, QL_EEH_FATAL = 12, + QL_ASIC_RECOVERY = 14, /* We are in ascic recovery. */ }; /* link_status bit definitions */ diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 930ae45..4fbefcf 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c @@ -2152,6 +2152,10 @@ void ql_queue_asic_error(struct ql_adapter *qdev) * thread */ clear_bit(QL_ADAPTER_UP, &qdev->flags); + /* Set asic recovery bit to indicate reset process that we are + * in fatal error recovery process rather than normal close + */ + set_bit(QL_ASIC_RECOVERY, &qdev->flags); queue_delayed_work(qdev->workqueue, &qdev->asic_reset_work, 0); } @@ -3818,11 +3822,17 @@ static int ql_adapter_reset(struct ql_adapter *qdev) end_jiffies = jiffies + max((unsigned long)1, usecs_to_jiffies(30)); - /* Stop management traffic. */ - ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); + /* Check if bit is set then skip the mailbox command and + * clear the bit, else we are in normal reset process. + */ + if (!test_bit(QL_ASIC_RECOVERY, &qdev->flags)) { + /* Stop management traffic. */ + ql_mb_set_mgmnt_traffic_ctl(qdev, MB_SET_MPI_TFK_STOP); - /* Wait for the NIC and MGMNT FIFOs to empty. */ - ql_wait_fifo_empty(qdev); + /* Wait for the NIC and MGMNT FIFOs to empty. */ + ql_wait_fifo_empty(qdev); + } else + clear_bit(QL_ASIC_RECOVERY, &qdev->flags); ql_write32(qdev, RST_FO, (RST_FO_FR << 16) | RST_FO_FR);