From patchwork Wed Dec 20 06:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10125063 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 06A9F6019C for ; Wed, 20 Dec 2017 06:57:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0CB929649 for ; Wed, 20 Dec 2017 06:57:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5B352964F; Wed, 20 Dec 2017 06:57:16 +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 3081229649 for ; Wed, 20 Dec 2017 06:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932434AbdLTG5O (ORCPT ); Wed, 20 Dec 2017 01:57:14 -0500 Received: from mail-sn1nam02on0059.outbound.protection.outlook.com ([104.47.36.59]:62584 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932388AbdLTG5G (ORCPT ); Wed, 20 Dec 2017 01:57:06 -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=JoaxcylKbWXjTu9t6ZSGnD6m+7S/kZgn0CKkiVy7IkQ=; b=WU3oqHBunIXCWo+O8zVg/H8PVYnDH4KB3cqXEgNuDyjp5tW6IxH4ogoaYffdB/8cw7FbQU7TLFdygdoUsc7mkRXXcQx8SclapUydsKVRtSHCDds8kRm571QEdwXjDZrRHQQp3Agq+kl/GANqRzG7Epk5v9o0/EvDcnOs512dae4= Received: from SN4PR0701CA0020.namprd07.prod.outlook.com (10.161.192.158) by BY2PR0701MB1942.namprd07.prod.outlook.com (10.163.155.155) 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:04 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::106) by SN4PR0701CA0020.outlook.office365.com (2603:10b6:803:28::30) 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:04 +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 BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) 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:56:50 +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:47 -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 vBK6ul6T021586; Tue, 19 Dec 2017 22:56:47 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBK6ulF9021585; Tue, 19 Dec 2017 22:56:47 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 10/43] qla2xxx: Replace GPDB with async ADISC command Date: Tue, 19 Dec 2017 22:56:11 -0800 Message-ID: <20171220065644.21511-11-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)(376002)(39380400002)(39860400002)(346002)(396003)(2980300002)(448002)(189003)(199004)(47776003)(76176011)(59450400001)(110136005)(48376002)(8676002)(1076002)(50466002)(81156014)(51416003)(54906003)(16586007)(106466001)(85326001)(8936002)(305945005)(50226002)(36756003)(5660300001)(42186006)(69596002)(316002)(80596001)(81166006)(6666003)(72206003)(356003)(2950100002)(2906002)(86362001)(87636003)(478600001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR0701MB1942; H:CAEXCH02.caveonetworks.com; FPR:; SPF:PermError; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD027; 1:CJ/izXVcs8hfDiOd1EL6icerdGUqdY8hxZo0hibysgjsIP5aRglHTNhRKxqIhnv0Sbi71oCZBcaZ2GKu+16enPgkW+lheB6vgdGRdJayEWb7fhPNAMiB/EunN2RH2hJQ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 125996c6-0f99-4b3e-52af-08d54776d8d1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BY2PR0701MB1942; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1942; 3:qatkX2Olgsq2bbTu3EnvSnqhnHVhXFxXr+egMiOgMSU2Tnf7SEwsvDSZ6FbUGTrlL03RvpxXlnzfSClz/SsOcual3SzhU1pHEqiMbU+EFyoYRTLAKGa3dS0F3ljUpG6hvhKJBZgcxsU7jcIMJOBO4R11fplClbIaAv2wU8cuHE/wn2qhncfL21oWNNLRn2bzQ0ascCbc9nNQTaVweyQ6YCTClUFzO9ezFeONzAo1bHvcUY4EZIsXYLrLv1ynk/lpzUYQdzZBQGbzKRcqycV92W7O8KoafICuhJvKuZ9omdl0nYkjFYdZn6960vvcIddUA9BPkKAih6X6l8kmj1+qgJuaeE3vX946kxi3oAXQP+w=; 25:oV+DKxOVLh9RBrb+9ZB6kvx6Vd68YAK1Ku5rxeAZrNc4eVZBPPQk5Yt6gVJhon2YcBUm+87gBAmaObGXF8Ouaa9qghpuFljZCRoWR/4G07ibsoOa3ShyaZBDXKLS6jvsdv9JZinI3AgjLsxTAF7maoSW7rmA6eQaak9Zr3LfxiWITovrzzgl0KWpBHGLrgSPFh+Y5kP1TZFhAL3T08G4zfnnVsFdV3hXpSbBvRB7jyoqk4h4A/rcPI43ZHn3kDWFRW6U0VufXQcYh9wLOBKtProQltcnQMtWdqQ793T6ZpoeQpfYdYRCUq+MYkvbAvZY81NE3VUKyyhalyBnIcQn7eR0SAdDrFapkDvN5QODoJg= X-MS-TrafficTypeDiagnostic: BY2PR0701MB1942: X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1942; 31:jvIRI7fGgM/1mJr6mLo1CasTnCVd0OWYN3OYK/G7ecgZ62eLMWHCdn3JwT29/XPrfPG6e1f1AD2Q6/87IYDdu25arXu9CCQejc+cM0k7pl17sT/D/0oGCiarahXPmURaQQbh0AYeiUacbPh9URQta+VP01pB5AqT7L1esKwZeatIcbAegC2y6ovXRKFDVCy6C6n0UffDdoapUMdY/Nr1xhT9+6EuawDUJNPYf7o3ybs=; 20:OW62H5cqNGGcMX/gJoah2BhWtEfUw9MvPks8Wcb4cLFPRDbmX5p0rKM37GabeFT56W/5iEnC944I6csH8RrWOcFy5+KdtgO3CTUXIWggSKiz8DUprm7BQFAzW49xvDcG2ykw69+D6fkGvWI0jKKySzmXg9yEyp+5P5HviCiEyHCXeOMaXsj/ktciqxXmsqOGPFed1OyaCDbzK2v2lGks0mzjErK8uA0kppdX+0AzzxK0zM9gfcbFn7B88QyZdFNiZQFc7B8bqw99qtce9k6ekJzWIagja6ufR3rsKQOGmbiodrq+sOgd94uqHZAxgnJXQcg0dLigcFWsayQ10e7QTk2upO9MsnSfbJpQ3rWznGqHI0F4tOjAuJOkoZ1++ASpatV+P7PfJ1AmtTtEw6R8L3M0WaK1/Rjp62EDTkGrIuIPNB8KLVI3EhMynBdEMIg6v5zFtPa7rrQxxn3LN7WTlGZPNzX5wDdvFI2jp/vJwUYX8vj3Y+xJHDi2x2ssutaJ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231023)(93006095)(93001095)(6041268)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:BY2PR0701MB1942; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BY2PR0701MB1942; X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1942; 4:BS4W0aucWX5U0w4gscXsx5MM4zE5cfXMWpzsPQ+0dFH5R7R53E1NIxAU2BVlsFXr5C0KoMHd/GhaDGC9qkUwKMn3Mmo+7mVBw1BUqQJmeigKJhOeSh25/YNWPzz8F3r5Woi+nP2nsB6IDtT4mcytyOJ8tfvxkaFGsQMNWeOMFkWJucPjcuM8t8VmUqigPOWH/04dB6xKjGVbyd6XRs4Zrj+sYh4OtgVxYBK1tnjb5zn4+qbkjV10P18NHhB16yBOTqORZIg1TPO4ZjheXhYrvWbtRrrAzX+/eoh0I3IKcjUamZv+x5djNnZ9rG/cWEfG X-Forefront-PRVS: 0527DFA348 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0701MB1942; 23:/vV9FxWcn3LSHjTruLSPccEZ/qsCuhE3URo7+uM?= =?us-ascii?Q?cTSlQm9+8I5dC9rV7WwJSRRfT9CJlrpTCD7hGuIDLdsc7ZRCajE2Ef2NunGi?= =?us-ascii?Q?MZfm9VNZQA0HLJJ2rbeXzrFgp4fk8InCjcuLLJZ98g7kOtQ9Bmd9/fpUFdfB?= =?us-ascii?Q?fo2poUAcv+Ht3nLDwVrp8XC8AhQ16pSTDp72tLUGphEgxeFCBuIvzBaynTMA?= =?us-ascii?Q?fSPECzDiuHQRpmmYTk8CkpKUoUzNoDnQhOp9kP5RBrOGs7v3ZYUn/wCZZoK2?= =?us-ascii?Q?3Rr44aVVctv8ey0lQD6NETckN3IU8K6WqQkBmxbLsLm+MpunD5S77ttbEIP0?= =?us-ascii?Q?CQxoN8KCaCR3WqHBmRp4gmVDjpePoBelKfGXncVKsxrQFUipWAAze9A8B7Ki?= =?us-ascii?Q?e2udfklOyqLFEfFND8QoGWbJMcsTRU+hUWFrOLW39Sp157PkdsykK6lEItO0?= =?us-ascii?Q?+552Rj9ZxYXBGp4NAn+aZ+stIAvz7QKyn4jXHea2DqayMCAYAyp5hn6WZSHN?= =?us-ascii?Q?/7HK1HMTaPf0w0kuRoCtHtdgFCznjw+VrbUJg3I4I/qklzJL/Moy5aO37Btd?= =?us-ascii?Q?+qLQD6R6B5AHdvRtkyU4OmHtmD66BODhMXQJNdugg8LAFcwgMVCjNa3PW1bQ?= =?us-ascii?Q?AL1syhVuJNZNeZSyI/ed7jzD+x+AI7KHIYFTOVosiHIV8DliLrFk5vkOGkN6?= =?us-ascii?Q?uoUTGnosDYdIq+Yf46A1nX6RmvbjSf44omOEDzVm0dFutMAr/ri+jj0RtvAQ?= =?us-ascii?Q?w6FgBQy/j8WuQzF600s+4uKDdt5ckDDF73pil0oqX5m7YxOwpAJjc9F2Obv9?= =?us-ascii?Q?fn5TMaHyMzk6csVLJP6bj/ODh01eBxXgIvwcMygzZe0Lz7RYpX2jFCg5hPLR?= =?us-ascii?Q?NqIe0BaiAd2N4itwbH2Cpi6DPNX/Lt5HuaDml0g9z2isSbF+n1556FULH3ur?= =?us-ascii?Q?NKcLHtTc1TuELJvgalWhvx4+v5t4aNhKduqYl2ifzvV6N2NJcft4+uuw+BR9?= =?us-ascii?Q?f6YYKWxmKFKXnoqWZdATgj4ZT?= X-Microsoft-Exchange-Diagnostics: 1; BY2PR0701MB1942; 6:xOP9pk6SxfbJ182rIR8x1Tj50lnV1AXdqpWE1xnk9sIZosT74kV/IrpgZ/pzX8yU+tE9L10cZFH0BxExE4pyBFPuLIJHIpwnZzuVH4pM+IdkRwvCcYlYqIpXL+Z1HmGLSc/MZJA1LbQSjhonVKX700YXjYiJR3PDllmkwdsjAtSQ2M8hxBeVLqn298kSvnZsS1w0wiJDlOzgSuLZyX2Zipyvq9+8WCau0ux8ohXv9vuLTTSgkw/pCH5kEY9/zD7W8Wpgx+p0p8E4aalWt6dCHOcn+eX4m9fFfzpqd+Zh/dGVOZvdvaASKUicATUVbKr30EgWCpaDxxkZZfoNj8qbt1hQeSCyArUssubzYGEu9Cw=; 5:EYEMHlNQd6I5sAxIRS5CgnV5wozXy0+/4/+PW/f3HZCH6zj2yyZUwh+kFUfUUlsY41qd22ASkdGE73fnAiYp/tY1hDQ6mgYxkIy6Knx1AgGnD5FgOTklck1wtksvwVKyS0ME7sQd6L6+gU5rR1M7gzSwdsdRYETzqK1OatHyXog=; 24:lC7sD1VjGaOJaUxmclzruSHWYsAbAJpw7O28xkkZrlxMWi4375/e1ellCKhgXzn91F7cGM9tioihSGEk2tud9u+OHYaQ9Anm1eeKu38HQeQ=; 7:oP8KCV/kR0/tP4hXB5Q/leYDu6xgslM4culCopNM0gKOk4zI02zj1S8Grybr+LKzjZ5XS5ICAG7UEiEVYnJ1CxFtX4y530TyzBYc+THNnTuSfPXeq0RpjqnPVnHb5nWhLZNDW1LFg4dzVi6MTPZP6eWkYfXaUFVvMckqNvLS8O9n8zkaV0QL5/4i+OKaJv0ij4I6VDpFRb7Qrlu6vib0s15LxXcSPZHCYGrGoO9t3pXZw4J7KEF30swRzYJegmnb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2017 06:56:50.8827 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 125996c6-0f99-4b3e-52af-08d54776d8d1 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: BY2PR0701MB1942 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 Replace call to Get Port DataBase MB with PDO_FORCE_ADISC flag with async ADISC command so driver can see ADISC command has error or not. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_def.h | 2 ++ drivers/scsi/qla2xxx/qla_gs.c | 20 +++++++----- drivers/scsi/qla2xxx/qla_init.c | 68 +++++++++++++++++++++++------------------ 3 files changed, 53 insertions(+), 37 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 8fbe1736a1a4..18b393453002 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2320,6 +2320,7 @@ enum discovery_state { DSC_GPSC, DSC_UPD_FCPORT, DSC_LOGIN_COMPLETE, + DSC_ADISC, DSC_DELETE_PEND, }; @@ -2346,6 +2347,7 @@ enum fcport_mgt_event { FCME_GPNID_DONE, FCME_GFFID_DONE, FCME_DELETE_DONE, + FCME_ADISC_DONE, }; enum rscn_addr_format { diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index 6aa6dd74fe86..b1c6485c307b 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2867,15 +2867,19 @@ void qla24xx_handle_gidpn_event(scsi_qla_host_t *vha, struct event_arg *ea) "%s %d %8phC post %s\n", __func__, __LINE__, fcport->port_name, (atomic_read(&fcport->state) == - FCS_ONLINE) ? "gpdb" : "gnl"); + FCS_ONLINE) ? "adisc" : "gnl"); if (atomic_read(&fcport->state) == - FCS_ONLINE) - qla24xx_post_gpdb_work(vha, - fcport, PDO_FORCE_ADISC); - else + FCS_ONLINE) { + u16 data[2]; + + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work( + vha, fcport, data); + } else { qla24xx_post_gnl_work(vha, fcport); + } break; } } else { /* fcport->d_id.b24 != ea->id.b24 */ @@ -3216,6 +3220,7 @@ void qla24xx_async_gpnid_done(scsi_qla_host_t *vha, srb_t *sp) void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) { fc_port_t *fcport, *conflict, *t; + u16 data[2]; ql_dbg(ql_dbg_disc, vha, 0xffff, "%s %d port_id: %06x\n", @@ -3290,8 +3295,9 @@ void qla24xx_handle_gpnid_event(scsi_qla_host_t *vha, struct event_arg *ea) ql_dbg(ql_dbg_disc, vha, 0x210d, "%s %d %8phC revalidate session with ADISC\n", __func__, __LINE__, fcport->port_name); - qla24xx_post_gpdb_work(vha, fcport, - PDO_FORCE_ADISC); + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, + data); break; case DSC_DELETED: ql_dbg(ql_dbg_disc, vha, 0x210d, diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 5cd04bfa5cae..0a1c287c2d66 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -41,6 +41,7 @@ static void qla24xx_handle_plogi_done_event(struct scsi_qla_host *, struct event_arg *); static void qla24xx_handle_prli_done_event(struct scsi_qla_host *, struct event_arg *); +static void qla24xx_handle_gpdb_event(scsi_qla_host_t *, struct event_arg *); /* SRB Extensions ---------------------------------------------------------- */ @@ -277,17 +278,31 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) fcport->flags &= ~FCF_ASYNC_SENT; return rval; } +static +void qla24xx_handle_adisc_event(scsi_qla_host_t *vha, struct event_arg *ea) +{ + qla24xx_handle_gpdb_event(vha, ea); +} static void qla2x00_async_adisc_sp_done(void *ptr, int res) { srb_t *sp = ptr; struct scsi_qla_host *vha = sp->vha; - struct srb_iocb *lio = &sp->u.iocb_cmd; + struct event_arg ea; + + ql_dbg(ql_dbg_disc, vha, 0x2066, + "Async done-%s res %x %8phC\n", + sp->name, res, sp->fcport->port_name); + + memset(&ea, 0, sizeof(ea)); + ea.event = FCME_ADISC_DONE; + ea.rc = res; + ea.fcport = sp->fcport; + ea.sp = sp; + + qla2x00_fcport_event_handler(vha, &ea); - if (!test_bit(UNLOADING, &vha->dpc_flags)) - qla2x00_post_async_adisc_done_work(sp->vha, sp->fcport, - lio->u.logio.data); sp->free(sp); } @@ -305,8 +320,11 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, if (!sp) goto done; + fcport->disc_state = DSC_ADISC; sp->type = SRB_ADISC_CMD; sp->name = sp_to_str(SPCN_ADISC); + sp->gen1 = fcport->rscn_gen; + sp->gen2 = fcport->login_gen; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); lio = &sp->u.iocb_cmd; @@ -319,15 +337,15 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, goto done_free_sp; ql_dbg(ql_dbg_disc, vha, 0x206f, - "Async-adisc - hdl=%x loopid=%x portid=%02x%02x%02x.\n", - sp->handle, fcport->loop_id, fcport->d_id.b.domain, - fcport->d_id.b.area, fcport->d_id.b.al_pa); + "Async-adisc - hdl=%x loopid=%x portid=%06x %8phC.\n", + sp->handle, fcport->loop_id, fcport->d_id.b24, fcport->port_name); return rval; done_free_sp: sp->free(sp); done: fcport->flags &= ~FCF_ASYNC_SENT; + qla2x00_post_async_adisc_work(vha, fcport, data); return rval; } @@ -869,7 +887,6 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) int rval = ea->rc; fc_port_t *fcport = ea->fcport; unsigned long flags; - u16 opt = ea->sp->u.iocb_cmd.u.mbx.out_mb[10]; fcport->flags &= ~FCF_ASYNC_SENT; @@ -900,8 +917,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) } spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); - if (opt != PDO_FORCE_ADISC) - ea->fcport->login_gen++; + ea->fcport->login_gen++; ea->fcport->deleted = 0; ea->fcport->logout_on_delete = 1; @@ -941,6 +957,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) { + u16 data[2]; if (fcport->login_retry == 0) return 0; @@ -999,23 +1016,11 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) break; } - if (fcport->flags & FCF_FCP2_DEVICE) { - u8 opt = PDO_FORCE_ADISC; - - ql_dbg(ql_dbg_disc, vha, 0x20c9, - "%s %d %8phC post gpdb\n", - __func__, __LINE__, fcport->port_name); - - fcport->disc_state = DSC_GPDB; - qla24xx_post_gpdb_work(vha, fcport, opt); - } else { - ql_dbg(ql_dbg_disc, vha, 0x20cf, - "%s %d %8phC post login\n", - __func__, __LINE__, fcport->port_name); - fcport->disc_state = DSC_LOGIN_PEND; - qla2x00_post_async_login_work(vha, fcport, NULL); - } - + ql_dbg(ql_dbg_disc, vha, 0x20cf, + "%s %d %8phC post login\n", + __func__, __LINE__, fcport->port_name); + fcport->disc_state = DSC_LOGIN_PEND; + qla2x00_post_async_login_work(vha, fcport, NULL); break; case DSC_LOGIN_FAILED: @@ -1029,10 +1034,10 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) case DSC_LOGIN_COMPLETE: /* recheck login state */ ql_dbg(ql_dbg_disc, vha, 0x20d1, - "%s %d %8phC post gpdb\n", + "%s %d %8phC post adisc\n", __func__, __LINE__, fcport->port_name); - - qla24xx_post_gpdb_work(vha, fcport, PDO_FORCE_ADISC); + data[0] = data[1] = 0; + qla2x00_post_async_adisc_work(vha, fcport, data); break; default: @@ -1264,6 +1269,9 @@ void qla2x00_fcport_event_handler(scsi_qla_host_t *vha, struct event_arg *ea) case FCME_DELETE_DONE: qla24xx_handle_delete_done_event(vha, ea); break; + case FCME_ADISC_DONE: + qla24xx_handle_adisc_event(vha, ea); + break; default: BUG_ON(1); break;