From patchwork Wed Dec 20 06:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10125097 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4EA546019C for ; Wed, 20 Dec 2017 06:57:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 469E129649 for ; Wed, 20 Dec 2017 06:57:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B7FE2964F; Wed, 20 Dec 2017 06:57:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7CC329649 for ; Wed, 20 Dec 2017 06:57:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932536AbdLTG5q (ORCPT ); Wed, 20 Dec 2017 01:57:46 -0500 Received: from mail-sn1nam01on0085.outbound.protection.outlook.com ([104.47.32.85]:33315 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932412AbdLTG5V (ORCPT ); Wed, 20 Dec 2017 01:57:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jhcPn2SYhPKv3ZQ55KY3oujRvKQKiSOAPMF8siFU7gA=; b=FbZQCFnvsGXUb/jplPE3QZlUvarkvxREMuIBNwsjaoTNJ/7Kf60mLWulPPwkqg4CIJ+x7O1SSpxUdkSAxcfyGceFc6uDbnnEVBGo5Gvnvq3iYmN6r4DyuLiW4/pfYFczkB6iqXcsmGnspwok+xGTUjixWvstat6VsMtqwnWRkWQ= Received: from DM5PR07CA0046.namprd07.prod.outlook.com (10.168.109.32) by BLUPR0701MB1940.namprd07.prod.outlook.com (10.163.121.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.323.15; Wed, 20 Dec 2017 06:57:19 +0000 Received: from BN1AFFO11FD026.protection.gbl (2a01:111:f400:7c10::102) by DM5PR07CA0046.outlook.office365.com (2603:10b6:3:16::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.323.15 via Frontend Transport; Wed, 20 Dec 2017 06:57:18 +0000 Authentication-Results: spf=permerror (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=cavium.com; Received-SPF: PermError (protection.outlook.com: domain of cavium.com used an invalid SPF mechanism) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD026.mail.protection.outlook.com (10.58.52.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.302.6 via Frontend Transport; Wed, 20 Dec 2017 06:57:05 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 19 Dec 2017 22:56:50 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id vBK6upIP021662; Tue, 19 Dec 2017 22:56:51 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBK6uoja021661; Tue, 19 Dec 2017 22:56:50 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 29/43] qla2xxx: Fix GPNFT/GNNFT error handling Date: Tue, 19 Dec 2017 22:56:30 -0800 Message-ID: <20171220065644.21511-30-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171220065644.21511-1-himanshu.madhani@cavium.com> References: <20171220065644.21511-1-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(396003)(39380400002)(39860400002)(376002)(2980300002)(448002)(199004)(189003)(2906002)(85326001)(356003)(4326008)(8676002)(106466001)(316002)(86362001)(81166006)(36756003)(81156014)(6666003)(5660300001)(305945005)(110136005)(54906003)(87636003)(16586007)(59450400001)(51416003)(42186006)(72206003)(478600001)(69596002)(8936002)(76176011)(48376002)(2950100002)(50226002)(80596001)(1076002)(47776003)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1940; H:CAEXCH02.caveonetworks.com; FPR:; SPF:PermError; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD026; 1:YGFWidib/kunsE8DTHfR04uj3/b9Alfq7ePtgJPzRDe8kafLc3s7ztfxy7bQYZKuI+Ug3FDlbgT1CaUryNj5CXDDvC4GLB1n/aS7crQUF5e9Y64CDQaCkAhm/ujzOMHk X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 088ce11f-bc07-45a0-25eb-08d54776e19c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BLUPR0701MB1940;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jKyqUSk=; 20:uqy8PX9vf1Fpoja4PpqTyNO6ZcRCqgGwfyXFveoJKvJCUaHONr5WMpNFOD6s4J7krwyTnX9QtJs0nhjdl2vwacBTl3PSFKrScXfFLAsrpRVMmM0QFiMjmeGX1DA5hfgXBVNBoCf1xIpQuEq7gdskxH65i/Bt9CRSR441qdNK8RWk6Tx5INupreGOTzwb7VjCedEfbIvOjuJcvidG1ZR8f+vewdSVFtqkCWcghkc+zSWv0aKWt04V0ObF1/ydy4R+5YRxd7Dzb9urRu1X3DZOTwNnsIt1jH4gLOVteE83ukCnFC8cAx1L5hwAidKV+YvJMvq2iSGDIVt6Jy4eniMyZ5jTtkPbuaZsN72rvI3s0PWvH05MILo7pwjHUVVROalIBW5FY3QGlVO9CT7N5mS0xPbK+hdymczPnLTseS8DNishW0VLpstPCnCicVHbC+AunKcOfAHcEGUnoec9jATsHWJBMg2HNmyoem/KzxPzbEs343EFneEzzXCSZVABDIgl X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(3231023)(10201501046)(93006095)(93001095)(6041268)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BLUPR0701MB1940; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR0701MB1940; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1940; 4:rK8heyy5916UDG8xUIgHBTSXW61jbupb7jmbBCXw1sIaIBaon49OweD3K8PH4rXUSOBQkNPK49uvMQQWM8zw1w0XS6uxMfEPxJeq7ycILrKUcIMRes5JKLc8cCGCVTI9vgX5Q7JyM3Jt4hUWE6+ANitw6I1JPYo/iFIR1uzvkv8OQUOQ3/H30ect7IXJ333aMmgCJvMTG+USAT4RZWA1T5G9JYMm9xvRswd0uC/bNqC65Epq6g4eOCXPRhL5ZtZk5Nzvm8aEop47ChtYJJoVIw== X-Forefront-PRVS: 0527DFA348 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1940; 23:YO6xTzisT9/qxlNmte5pKZUR41ENkAgDizbUt6W?= =?us-ascii?Q?tlbEMOCUsbeXSxCY+awwKEC3vWbdcgwzEsDiY4bV8WuBS0TR7R+xloxx92zr?= =?us-ascii?Q?RIkE3m8gCkKkxKzXuyC0PtUhy3dISeHuzCKx2fueDrq7guA5tRDOZbvPVOHo?= =?us-ascii?Q?yB7t9OsymQ7YODiYApDQAKc7icCJYUIclGOyCoGciIQS6bd1IhQcDRKQxwpB?= =?us-ascii?Q?1041yKC5w6iOzPXn+9ImhY19KA0I43K0CZzcNAL5aabgfa7oCIJm7OBn/TxJ?= =?us-ascii?Q?vKoZXLlGKRp0GWsnCiop7nNb2I9Mudk3vPBVrK1HmUPAyYBt7fQlWdc+M+36?= =?us-ascii?Q?SiWbY/A3DW/CBHKGrdiW4McqmnedV3yLoZsckisIsHqNzKznQiCzxl3fBCyB?= =?us-ascii?Q?41doewDnCNi23cJ9BO213lMf+oNUHvbz3c5euuKdeFoZrsb5fmI7Doh4p+l/?= =?us-ascii?Q?cUG/Pft622BXu4q+LDmhlEDCUcCIGT6WjkBnKYMW9r2UiMTN6Cklewcu2Mhl?= =?us-ascii?Q?9vf9MSl5OlrwwVfdY4DyY5JYSN9rQwS3W+zCmwrEde5f39lJToR5NLCGQJEC?= =?us-ascii?Q?hQwD46oAiwfNkybjuMAV0q6cBdDZH72nK/NheBDyvVBdKl+U0saAjdrSrJmB?= =?us-ascii?Q?H0pr8GzKikpVHiU81O27YUTXz7xnYqCPWrK+His2JCYq4km+im7oAFVqiMzZ?= =?us-ascii?Q?PZJ3FKm9Uwyiy9h6swUaW+WADEXOTizY+MQCzUA946HcPjoj2W/5/YQGbbSg?= =?us-ascii?Q?Ytv2lTbPo9pnjUjeYYDVqAhVqTfZtgTaujetsjlfcY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j29tWjh++y9Xc2oI11RUKH+0mRcp9GjkOOeZDph3u13tp04iHXw3kmkGg9BqYNzuD/Pt8gcLkA71STiN6AdZg52ht9EOU0yjeYT6R7nyGrLcGJbNnrRPVlmdrkrFKC95FaOJ4j+iw6CEFyRDpETAPycT4I SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 06:57:05.6181 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 088ce11f-bc07-45a0-25eb-08d54776e19c X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1940 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran retry gpnft/gnnft if error is encountered. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 15 +++++++++++++++ drivers/scsi/qla2xxx/qla_init.c | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 0e84381e227e..0fcbdcaba127 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3927,6 +3927,7 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) ql_dbg(ql_dbg_disc, vha, 0xffff, "GPNFT failed. FC4type %x. Rescanning.\n", fc4type); + set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); goto out; } @@ -4036,6 +4037,19 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) "Async done-%s res %x FC4Type %x\n", sp->name, res, sp->gen2); + if (res) { + unsigned long flags; + + ql_dbg(ql_dbg_disc, sp->vha, 0xffff, + "Async done-%s timed out.\n", + sp->name); + sp->free(sp); + set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); + set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); + qla2xxx_wake_dpc(vha); + return; + } + if (!res) { port_id_t id; u64 wwn; @@ -4097,6 +4111,7 @@ static void qla2x00_async_gpnft_gnnft_sp_done(void *s, int res) "Async done-%s unable to alloc work element\n", sp->name); sp->free(sp); + set_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); set_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags); return; } diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 152c808b272b..e58faa1e984c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -683,15 +683,15 @@ qla24xx_async_gnl_sp_done(void *s, int res) } } - id.b.domain = e->port_id[0]; + id.b.domain = e->port_id[2]; id.b.area = e->port_id[1]; - id.b.al_pa = e->port_id[2]; + id.b.al_pa = e->port_id[0]; id.b.rsvd_1 = 0; if (!found && wwn && !IS_SW_RESV_ADDR(id)) { ql_dbg(ql_dbg_disc, vha, 0x2065, - "%s %d %8phC post new sess\n", - __func__, __LINE__, (u8 *)&wwn); + "%s %d %8phC %06x post new sess\n", + __func__, __LINE__, (u8 *)&wwn, id.b24); wwnn = wwn_to_u64(e->node_name); qla24xx_post_newsess_work(vha, &id, (u8 *)&wwn, (u8 *)&wwnn, NULL, FC4_TYPE_UNKNOWN);