From patchwork Tue May 1 16:01:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10374149 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 73D476053D for ; Tue, 1 May 2018 16:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6246D28426 for ; Tue, 1 May 2018 16:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56A4828988; Tue, 1 May 2018 16:02:14 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, 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 6DE9828426 for ; Tue, 1 May 2018 16:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756003AbeEAQCL (ORCPT ); Tue, 1 May 2018 12:02:11 -0400 Received: from mail-bl2nam02on0073.outbound.protection.outlook.com ([104.47.38.73]:34736 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755942AbeEAQCG (ORCPT ); Tue, 1 May 2018 12:02:06 -0400 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=6hQfoNvrw96c1tIivpkY807sLm96Fd2x4jsOPBCElsI=; b=O2KhdneI7mwpGV3f67w3sBwi/ZW2J8rV9HV5m4Ze7WcLrHMfGEBlO55WZI/KbYmKVVLRDjsizejw+ALt+TbjCfBqkAIh8M2PXsP2JZ56dt6P+YQuF5359vlBVX3INRv7rQUS1WcH+AoA9pnBMI3KkWm9rZVyZ+37I9vEOTULExQ= Received: from DM5PR07CA0083.namprd07.prod.outlook.com (2603:10b6:4:ad::48) by BN6PR07MB2818.namprd07.prod.outlook.com (2603:10b6:404:40::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.715.18; Tue, 1 May 2018 16:02:03 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::112) by DM5PR07CA0083.outlook.office365.com (2603:10b6:4:ad::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.715.18 via Frontend Transport; Tue, 1 May 2018 16:02:03 +0000 Authentication-Results: spf=pass (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=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.696.11 via Frontend Transport; Tue, 1 May 2018 16:02:03 +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, 1 May 2018 09:02:00 -0700 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 w41G1uUT027974; Tue, 1 May 2018 09:01:56 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w41G1uiX027973; Tue, 1 May 2018 09:01:56 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 06/12] qla2xxx: Move GPSC and GFPNID out of session management Date: Tue, 1 May 2018 09:01:48 -0700 Message-ID: <20180501160154.27915-7-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180501160154.27915-1-himanshu.madhani@cavium.com> References: <20180501160154.27915-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)(396003)(39380400002)(39860400002)(346002)(376002)(2980300002)(438002)(189003)(199004)(5660300001)(54906003)(126002)(42186006)(486006)(316002)(2616005)(11346002)(50226002)(446003)(72206003)(44832011)(106002)(47776003)(476003)(110136005)(81166006)(478600001)(8936002)(87636003)(6666003)(16586007)(4326008)(2906002)(76176011)(86362001)(59450400001)(336012)(50466002)(80596001)(26005)(69596002)(106466001)(51416003)(356003)(48376002)(1076002)(81156014)(8676002)(575784001)(36756003)(186003)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB2818; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD008; 1:uk/GirVVF7dyc0fzJ620Fe/O/BYyvBZkXSWpiEWIh+SzgTDxSB3BKdC/0opXJUycdVJxoJGGrz+vRwe206MeRDdr5+Sy4xlJQUPkooKEp4w3mq5glI7MTaPS/eH7btP8 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:BN6PR07MB2818; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2818; 3:rAgbcEBRszgCsODtVz+M5xRoQz7ASkH8IT/or4/0O0bl4JKKHqzy6ukvAC4J7uk47i8/ZyhAQQvfWmLBLmf5cJmhSjSs0wSTvAC/hU2pCZqH+j14SbpiS+uG6eZMt3d2YEt8p5rZqdOWZ4pPB+DgQgnNHKO8RS5cCiJdcbU6Mc+3SQqQzM5Mw4t79Byvp12GUENzfDBu6ta1dszcLOF/cwSghLsmbq7jVJ2hprtLmvnN5E3B5D6eE++m4AOSjUPbziWN4GYTiHUyue9f4d2YTP22rjXur8LlYOtIP4GnAza4X7z8vNLgL0lMv8MfJEVYcoYSs6tJmHN8UAyzNDnZcw==; 25:NUfAvDZlFq+rgRPo2RgSKvkxfRSYqFtBe0JY/n1g5DWo/EDV9aD9rNQphD+bF4T0S3TCUpuRbG5nvxWAd94U9KRr5ATl/cqgxg4KtI+Hxfj7CUZxE6vqkgBiIdxrG9/n80bjeGFlzKX//3H7KC/Ddqe99gE5OmKnZiPdUsxosyp4DOSdWCQwRiKlgHwh1zCByh7ai+nEyDe3m+hJMRIIH0mBdS0v1cqKm52+H822yHOkha5sz1cso2iC6IDpvzXJxlIN2CjMVipaPDpMy69kpgx0PCQh4CfPjdMJtjYhKYorisI4DBvqCkfxW05+DnaQU+qzgE88X4kk3XWG+6R/1A==; 31:K1DKL9tmhFMy9JES8IHHu1rnC2EsYOJ6N7H2BTYKcqqAUntUsvPY6ghSpKNF5vvPNdLaVSGHTD3j33C8FSyMSY3BHfSC18Zx8KYIh7trSV29Wc4COMocQ8IGwhns3gEPEApWEDmJpK4AkeLx8w0+Oely4AXd0o2ebFhW7Zl2fqmviSZxd2MMHyciUxYx7jRvsl88CYRX8H7hra/+xVdyJUm54DVLNEkdg/CYmmttRuI= X-MS-TrafficTypeDiagnostic: BN6PR07MB2818: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2818; 20:rGc6Lhy1t+exAqIZeTlMyuDzsKM5nnXIgNErV5zyeNh0ERWb4mgc4Ce2p2agWRsW3W4Tffz7Mtbuk0GTGLJo4uOj38bLEPEiQduwRMVmSbXHY7rY36PBHy4YDSjqnDCnFEv6zUfh/t7FtBhWy7Po7P2F8fOxjc7PxkKWl4D92GAm+5UcudtC0dIbkjLwQovsX4XJEBGlQRI/hy5Z9A3JnOlc8K04fhp7y9b8nq5q54SpdJfz58BAVBktiZ258fWtj7J/XTL743Ux5QJAFqlYdTYhAPqlk9Csd+psUywuq7SvpALlpDqSqTT3UALkRHiKUny0ojlz+ZnLk81Asbr5TLpH0GF4BK8LCjSJuABEWuQ/wz9zD0DxKNrrj54dfH24d3mdIHyGO1nteKmziqFs1PvRaY7eeYwQ5sK3xkCtXeX3yik3WzFHJI2wqFF/otXToH4iFBy2Vi3ZqefWUIjid1dYRoth6Rp9BGDt7DMx60Aob9YcPo3I0qR8ZCIS9oEm; 4:PTqqjqgcE6lFnVg3L0tjMDNCNbuKl3rcMG0Lrb6JBHENqFIOx3z81ieWREgLgaOnkiGkDwTj92Y0EhNbd30ti52lpMQA4a/t7sDGyjCASJQLy9lN35v3CxJxMTOOUUN2mnZZnPegXRKhnQpvQ0FWcU8ZWyQ8micX8PrpZgtxNcrrYRobpYc3RN2MpEdh3wVt1AjwObJnJHEfRGUcn49h4pM2PDFgsRQOJPwTv1eFcuPck/+lYdbxTUVRoYh/aPzpbqxkuYxRii0revQKOSRLQ++Po9QCZbyenR+djuvt886578g9+TlMMeJfU8XPydDG19rgmJEziT6tyxJ+AJHO9bcmeq174bw+llZ4TfK/lUQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(209352067349851)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(3231254)(944501410)(52105095)(10201501046)(6041310)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BN6PR07MB2818; BCL:0; PCL:0; RULEID:; SRVR:BN6PR07MB2818; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB2818; 23:oIMSO+L5Q0hF1AfSZoG2aYiJlaIiLyzMY0j8vd3sU?= =?us-ascii?Q?duXVx+N3cKZz5RwJwQH6EoA+fq+/YUpTnjYHGSjyoQUFvdu6oKFEYmg6f8zi?= =?us-ascii?Q?mebeKWBOIi99ik3Avegqp78hDqQ/3A1mG7y1TYmOrKj18hU++Drivy4oQstW?= =?us-ascii?Q?XWWggXhcrlDz+ojQqW9RlUTzK27x8NOMt/ThXyr7kgKcpusfrmrLQIY5KcSy?= =?us-ascii?Q?G7sNp9ga7wufW8dHPx5fQSS+XCvwkpCYFwcaKBciVAqJeogncoEIMP/qJhHk?= =?us-ascii?Q?VlEuscWn7S34dk1wvOVl5QLaJ48azX6nRX/gFD4OFEvg1pOpePthApvPl1KS?= =?us-ascii?Q?AJMYea239nzQ6XQGEDqBbjqrKF6/zLCdkaTymj1WAaNe6ctPbhiZjAi2J5Wv?= =?us-ascii?Q?6BitJt7nuv73eIh7ajzGd83WKMh0svAP5qj7cw4SwRbyPC54DTQRAMKWaNeK?= =?us-ascii?Q?lFReIoOz3DGs5HCl7nQfoH9461ZKCCkVtzBKSymgKU9xShIl+8i3OIaMCvzL?= =?us-ascii?Q?wzhVxu497b4gGk1OQ62TYtSHBOpjyjWYqc3d15olZBRAL0k2oBHW1CD1G4Mk?= =?us-ascii?Q?iLYYC9cJr+qy5gncgLIzZ/pGrY/u9iqzQGzbNCSbbo3YvSTAEhWlwYP21U1q?= =?us-ascii?Q?4FLHjWDok6kE/8kR6tGuv6NRvZ2GgdZZqTd7VuBP2kVWbuQkIrowlAluzGTK?= =?us-ascii?Q?gcq2TOkXjVHvBIaNcQ1OtZcmamcCggCDtA+lDbHlxiM85bfWNkksQuNeVtlQ?= =?us-ascii?Q?wQOAf+KKW1A1agDdsRa8BDxeFgtwvmTyzTmbvDkKV+QX4axUAy7NZlxVcrxW?= =?us-ascii?Q?0pjPr1Mbc9y7Uo1MQRnjbVRQ0wYHw8E7o3Tc5YHGs+jHxpkCl6wE6DdAJ3VS?= =?us-ascii?Q?l+284H1Lgtb+BoHPD7wNPwGmvDb1inRZp4OPvmhIo6eEG5MnU5+5D4aXL69R?= =?us-ascii?Q?8DYAuxu+aq+Lq04DnPtWJ5wkvxuhr2s0eTQv1dE5YmDek4WCNRdYWlpMF9/V?= =?us-ascii?Q?l/jrJiXcJ4OcCBPLDMHkR059Mxu0+0bTAJTniukjFrxt6rIUuPOcw7To8zWS?= =?us-ascii?Q?pM1RfTozS9A/xyXnceyVyJC5N1myiH8OrWYTCuPW/UAGDs4SlAG3FGizl6Ug?= =?us-ascii?Q?CoO1yRr0Mcg28ECcSOiU3WfvyMylJ+sUPR8phGExKkC6dAvqOUmqQtnbARvF?= =?us-ascii?Q?HzT5zbSuKW+/Rc=3D?= X-Microsoft-Antispam-Message-Info: 562NbT4QeIsksE6nyLcAvrq1t4RuekJq1zuJtMZGu0o48t4R+n1fWjToq01RvaFWQvNsQDFGnet28DPDMRKZqGj4xV6vNuC7H1zrgGVNAolOQtrffNxTjSb8mazx6rrZOSdAh3PMVA8wYvtjqtXJOu6pf94UtpMPUPRMMw7FqSb5cchgXKo1r4mjYbT0M1kz X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2818; 6:II5lub5em7YYlV+tb09WfCOsJGDjhk9dAJNzxB6tMG3uSlgjfKO/h0LszDctkeRGgX76ltkoLb180DWY/kpPFB7k290NxIywcXJFtopN352TsApQ1hT0So9g48kne7Q/vU/5kouYgFiAfExnoS2bI8c0Wp2RDxrtILe+Lz8JLgquj+3MKg+eli+msudUVVx6SM9aTw2kbERhkI4VxOZ43f8O0GrpWNoFk2o/zDhIj9jPjRbwNBXw6D3fVZ6k5/yOTHmS/wcCtsasnTmRKlSDOU0vTFeit49X+1sORSst/CqfB+E/TES24c9bt0kBkGaisLEkncWYXIPpDaz7rl6uOsJiJ0ehoECHaIAfTt3dfAA5nnmbD/IjxeQgGQcmKX9mablf7S4cme+risOzN5B149GR7PPEbTi6v0kMr/p9qDuF8CtUbry3a6HT6UdD+bk/8kYSYZqMHt3woIskW64Wdg==; 5:a8UKbwIneE9Gu1jUswxl7V/ilxxpAr9+WSwaw00fnKKuH5I2rxw8STTjkzMQN+9FRtyuPH0kqpqkV3FaFcXyHek+jsZXmO1QomCo1pA/Z1UsOuyP2vrMnXads6UcJ5BqwwgotuOteJwEtcfaHcBtoshPiHjFLoOk8Yca7C9QiuY=; 24:iBqzh2OUzYoCqXUpCBo4sSSMRpAwcm/PKXeA05yL14Jlu1/9j6ld5FreKyIsd7iOqEApIwlXJHQCCFzuTDAfgvZEU5/CmpTHy0X5YcCQ2F4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB2818; 7:RT8fuarWAxJN3DBLI6IizedSiAm2BJdOIDK0/ivR/fLrged2QDK7N+FPXhqx5MIxJ0TbjxJ/jLa0P3/AailqKpqNjJA5HLS/WhcL5cFuMBtBuStHqUD8fl3f9tM+dLSHM9mYqmhqSzuyQHnwIZOU+n7182VW65G6N5ebosQp7aa54K2cihEmjEV9HRKu8VCW0Pb6Tc23a7Eexj63YUwmhIYvWbb3Lhwbc90llDf01CYmdyWtiSEvXkRgLLn9YIQN X-MS-Office365-Filtering-Correlation-Id: 0d5bf026-6b20-4489-6ef3-08d5af7ce136 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2018 16:02:03.0011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0d5bf026-6b20-4489-6ef3-08d5af7ce136 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: BN6PR07MB2818 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 Move GPSC & GFPNID commands out of session management to reduce time lag in reporting the session state to remote port. These commands are not essential when it comes to maintaining the rport state. Delay sending these commands after rport state is set to Online. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 3 +- drivers/scsi/qla2xxx/qla_gbl.h | 3 +- drivers/scsi/qla2xxx/qla_gs.c | 10 +---- drivers/scsi/qla2xxx/qla_init.c | 78 +++++++++++++++++++++++---------------- drivers/scsi/qla2xxx/qla_os.c | 4 ++ drivers/scsi/qla2xxx/qla_target.c | 1 - 6 files changed, 55 insertions(+), 44 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index b4d98e3f2416..eab40acde9ea 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2285,8 +2285,6 @@ enum discovery_state { DSC_LOGIN_PEND, DSC_LOGIN_FAILED, DSC_GPDB, - DSC_GFPN_ID, - DSC_GPSC, DSC_UPD_FCPORT, DSC_LOGIN_COMPLETE, DSC_ADISC, @@ -3234,6 +3232,7 @@ enum qla_work_type { QLA_EVT_GNNID, QLA_EVT_GFPNID, QLA_EVT_SP_RETRY, + QLA_EVT_IIDMA, }; diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 3c4c84ed0f0f..f68eb6096559 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h @@ -116,7 +116,8 @@ extern int qla2x00_post_async_prlo_work(struct scsi_qla_host *, fc_port_t *, uint16_t *); extern int qla2x00_post_async_prlo_done_work(struct scsi_qla_host *, fc_port_t *, uint16_t *); - +int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); +void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport); /* * Global Data in qla_os.c source file. */ diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 939ac8435f19..4bc2b66b299f 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3175,7 +3175,6 @@ int qla24xx_async_gidpn(scsi_qla_host_t *vha, fc_port_t *fcport) done_free_sp: sp->free(sp); - fcport->flags &= ~FCF_ASYNC_SENT; done: fcport->flags &= ~FCF_ASYNC_ACTIVE; return rval; @@ -3239,7 +3238,7 @@ void qla24xx_handle_gpsc_event(scsi_qla_host_t *vha, struct event_arg *ea) return; } - qla24xx_post_upd_fcport_work(vha, ea->fcport); + qla_post_iidma_work(vha, fcport); } static void qla24xx_async_gpsc_sp_done(void *s, int res) @@ -3257,8 +3256,6 @@ static void qla24xx_async_gpsc_sp_done(void *s, int res) "Async done-%s res %x, WWPN %8phC \n", sp->name, res, fcport->port_name); - fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); - if (res == (DID_ERROR << 16)) { /* entry status error */ goto done; @@ -3327,7 +3324,6 @@ int qla24xx_async_gpsc(scsi_qla_host_t *vha, fc_port_t *fcport) if (!sp) goto done; - fcport->flags |= FCF_ASYNC_SENT; sp->type = SRB_CT_PTHRU_CMD; sp->name = "gpsc"; sp->gen1 = fcport->rscn_gen; @@ -4555,7 +4551,6 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport) done_free_sp: sp->free(sp); - fcport->flags &= ~FCF_ASYNC_SENT; done: return rval; } @@ -4617,7 +4612,6 @@ static void qla2x00_async_gfpnid_sp_done(void *s, int res) struct event_arg ea; u64 wwn; - fcport->flags &= ~FCF_ASYNC_SENT; wwn = wwn_to_u64(fpn); if (wwn) memcpy(fcport->fabric_port_name, fpn, WWN_SIZE); @@ -4646,12 +4640,10 @@ int qla24xx_async_gfpnid(scsi_qla_host_t *vha, fc_port_t *fcport) if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) return rval; - fcport->disc_state = DSC_GFPN_ID; sp = qla2x00_get_sp(vha, fcport, GFP_ATOMIC); if (!sp) goto done; - fcport->flags |= FCF_ASYNC_SENT; sp->type = SRB_CT_PTHRU_CMD; sp->name = "gfpnid"; sp->gen1 = fcport->rscn_gen; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 98d4b315d66a..792c09470c5a 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1021,30 +1021,11 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) vha->fcport_count++; ea->fcport->login_succ = 1; - if (!IS_IIDMA_CAPABLE(vha->hw) || - !vha->hw->flags.gpsc_supported) { - ql_dbg(ql_dbg_disc, vha, 0x20d6, - "%s %d %8phC post upd_fcport fcp_cnt %d\n", - __func__, __LINE__, ea->fcport->port_name, - vha->fcport_count); - - qla24xx_post_upd_fcport_work(vha, ea->fcport); - } else { - if (ea->fcport->id_changed) { - ea->fcport->id_changed = 0; - ql_dbg(ql_dbg_disc, vha, 0x20d7, - "%s %d %8phC post gfpnid fcp_cnt %d\n", - __func__, __LINE__, ea->fcport->port_name, - vha->fcport_count); - qla24xx_post_gfpnid_work(vha, ea->fcport); - } else { - ql_dbg(ql_dbg_disc, vha, 0x20d7, - "%s %d %8phC post gpsc fcp_cnt %d\n", - __func__, __LINE__, ea->fcport->port_name, - vha->fcport_count); - qla24xx_post_gpsc_work(vha, ea->fcport); - } - } + ql_dbg(ql_dbg_disc, vha, 0x20d6, + "%s %d %8phC post upd_fcport fcp_cnt %d\n", + __func__, __LINE__, ea->fcport->port_name, + vha->fcport_count); + qla24xx_post_upd_fcport_work(vha, ea->fcport); } else if (ea->fcport->login_succ) { /* * We have an existing session. A late RSCN delivery @@ -5058,6 +5039,24 @@ qla2x00_iidma_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) } } +void qla_do_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) +{ + qla2x00_iidma_fcport(vha, fcport); + qla24xx_update_fcport_fcp_prio(vha, fcport); +} + +int qla_post_iidma_work(struct scsi_qla_host *vha, fc_port_t *fcport) +{ + struct qla_work_evt *e; + + e = qla2x00_alloc_work(vha, QLA_EVT_IIDMA); + if (!e) + return QLA_FUNCTION_FAILED; + + e->u.fcport.fcport = fcport; + return qla2x00_post_work(vha, e); +} + /* qla2x00_reg_remote_port is reserved for Initiator Mode only.*/ static void qla2x00_reg_remote_port(scsi_qla_host_t *vha, fc_port_t *fcport) @@ -5126,13 +5125,14 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) if (IS_QLAFX00(vha->hw)) { qla2x00_set_fcport_state(fcport, FCS_ONLINE); - goto reg_port; + } else { + fcport->login_retry = 0; + fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); + fcport->disc_state = DSC_LOGIN_COMPLETE; + fcport->deleted = 0; + fcport->logout_on_delete = 1; + qla2x00_set_fcport_state(fcport, FCS_ONLINE); } - fcport->login_retry = 0; - fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); - fcport->disc_state = DSC_LOGIN_COMPLETE; - fcport->deleted = 0; - fcport->logout_on_delete = 1; qla2x00_set_fcport_state(fcport, FCS_ONLINE); qla2x00_iidma_fcport(vha, fcport); @@ -5144,7 +5144,6 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) qla24xx_update_fcport_fcp_prio(vha, fcport); -reg_port: switch (vha->host->active_mode) { case MODE_INITIATOR: qla2x00_reg_remote_port(vha, fcport); @@ -5163,6 +5162,23 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) default: break; } + + if (IS_IIDMA_CAPABLE(vha->hw) && vha->hw->flags.gpsc_supported) { + if (fcport->id_changed) { + fcport->id_changed = 0; + ql_dbg(ql_dbg_disc, vha, 0x20d7, + "%s %d %8phC post gfpnid fcp_cnt %d\n", + __func__, __LINE__, fcport->port_name, + vha->fcport_count); + qla24xx_post_gfpnid_work(vha, fcport); + } else { + ql_dbg(ql_dbg_disc, vha, 0x20d7, + "%s %d %8phC post gpsc fcp_cnt %d\n", + __func__, __LINE__, fcport->port_name, + vha->fcport_count); + qla24xx_post_gpsc_work(vha, fcport); + } + } } /* diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index bec8459523bd..c087eaa5b4bb 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -5077,6 +5077,10 @@ qla2x00_do_work(struct scsi_qla_host *vha) break; case QLA_EVT_SP_RETRY: qla_sp_retry(vha, e); + break; + case QLA_EVT_IIDMA: + qla_do_iidma_work(vha, e->u.fcport.fcport); + break; } if (e->flags & QLA_EVT_FLAG_FREE) kfree(e); diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 85640707cceb..3e8bf728e884 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -4835,7 +4835,6 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, switch (sess->disc_state) { case DSC_LOGIN_PEND: case DSC_GPDB: - case DSC_GPSC: case DSC_UPD_FCPORT: case DSC_LOGIN_COMPLETE: case DSC_ADISC: