From patchwork Tue May 7 19:55:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shahed Shaikh X-Patchwork-Id: 242458 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 56F232C0150 for ; Wed, 8 May 2013 06:20:28 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758673Ab3EGUUY (ORCPT ); Tue, 7 May 2013 16:20:24 -0400 Received: from ch1ehsobe004.messaging.microsoft.com ([216.32.181.184]:40243 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758587Ab3EGUUX (ORCPT ); Tue, 7 May 2013 16:20:23 -0400 Received: from mail202-ch1-R.bigfish.com (10.43.68.254) by CH1EHSOBE008.bigfish.com (10.43.70.58) with Microsoft SMTP Server id 14.1.225.23; Tue, 7 May 2013 20:20:22 +0000 Received: from mail202-ch1 (localhost [127.0.0.1]) by mail202-ch1-R.bigfish.com (Postfix) with ESMTP id 32049602C2; Tue, 7 May 2013 20:20:22 +0000 (UTC) X-Forefront-Antispam-Report: CIP:198.70.193.115; KIP:(null); UIP:(null); IPV:NLI; H:avcashub1.qlogic.com; RD:avcashub1.qlogic.com; EFVD:NLI X-SpamScore: 1 X-BigFish: VPS1(zzzz1f42h1fc6h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ahzz8275bhz2ei2a8h668h839hd24he5bhf0ah107ah11b5h121eh1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h14afh1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1155h) Received-SPF: neutral (mail202-ch1: 198.70.193.115 is neither permitted nor denied by domain of qlogic.com) client-ip=198.70.193.115; envelope-from=shahed.shaikh@qlogic.com; helo=avcashub1.qlogic.com ; 1.qlogic.com ; Received: from mail202-ch1 (localhost.localdomain [127.0.0.1]) by mail202-ch1 (MessageSwitch) id 1367958018637541_30299; Tue, 7 May 2013 20:20:18 +0000 (UTC) Received: from CH1EHSMHS032.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.241]) by mail202-ch1.bigfish.com (Postfix) with ESMTP id 9028E220054; Tue, 7 May 2013 20:20:18 +0000 (UTC) Received: from avcashub1.qlogic.com (198.70.193.115) by CH1EHSMHS032.bigfish.com (10.43.70.32) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 7 May 2013 20:20:17 +0000 Received: from dut6217.mv.qlogic.com (172.29.56.217) by qlc.com (10.1.4.190) with Microsoft SMTP Server id 14.2.318.1; Tue, 7 May 2013 13:20:15 -0700 Received: by dut6217.mv.qlogic.com (Postfix, from userid 0) id BA5715220ED; Tue, 7 May 2013 15:55:52 -0400 (EDT) From: Shahed Shaikh To: CC: , , Manish Chopra Subject: [PATCH net 6/8] qlcnic: Fix bug in diagnostics test reset recovery path Date: Tue, 7 May 2013 15:55:04 -0400 Message-ID: <1367956506-3290-7-git-send-email-shahed.shaikh@qlogic.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1367956506-3290-1-git-send-email-shahed.shaikh@qlogic.com> References: <1367956506-3290-1-git-send-email-shahed.shaikh@qlogic.com> 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: Manish Chopra o In order to perform reset recovery during diagnostics tests, current device status information need to be preserved. This patch makes the required changes in diagnostics routines Signed-off-by: Manish Chopra Signed-off-by: Shahed Shaikh --- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c index 8a82003..c38c6f6 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c @@ -1276,11 +1276,13 @@ out: return err; } -static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test) +static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test, + int num_sds_ring) { struct qlcnic_adapter *adapter = netdev_priv(netdev); struct qlcnic_host_sds_ring *sds_ring; struct qlcnic_host_rds_ring *rds_ring; + u16 adapter_state = adapter->is_up; u8 ring; int ret; @@ -1304,6 +1306,10 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test) ret = qlcnic_fw_create_ctx(adapter); if (ret) { qlcnic_detach(adapter); + if (adapter_state == QLCNIC_ADAPTER_UP_MAGIC) { + adapter->max_sds_rings = num_sds_ring; + qlcnic_attach(adapter); + } netif_device_attach(netdev); return ret; } @@ -1596,7 +1602,8 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode) if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) return -EBUSY; - ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST); + ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST, + max_sds_rings); if (ret) goto fail_diag_alloc; @@ -3109,7 +3116,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev) if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) return -EIO; - ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST); + ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST, + max_sds_rings); if (ret) goto fail_diag_irq;