From patchwork Thu Dec 28 20:33:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10135879 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 DDE4560318 for ; Thu, 28 Dec 2017 20:34:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFD012AD58 for ; Thu, 28 Dec 2017 20:34:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C4C2B2B88E; Thu, 28 Dec 2017 20:34:31 +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 24D282AD58 for ; Thu, 28 Dec 2017 20:34:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755185AbdL1UeS (ORCPT ); Thu, 28 Dec 2017 15:34:18 -0500 Received: from mail-bn3nam01on0057.outbound.protection.outlook.com ([104.47.33.57]:58208 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754537AbdL1UeG (ORCPT ); Thu, 28 Dec 2017 15:34: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=6TDDYcDN4+Vtp/X2RA3bp1tF7QCNe177B2V1CX9kah0=; b=nbEVB2qpTUHvx3M0gY67+JYiKiP0yika2GxrUrYcwj2IydUoLMQSNb7dSiquZSI8x3ADHfNJhs/22e9k2o+io7ACKmEF5Zej0ZBqFYMIZEqkHxbHC+OLbDuJHxI9eLZWRW+vOPGoZK2dJOPH4Rwnu3NDw2Xtq41wVfWQAWHqoqk= Received: from SN4PR0701CA0023.namprd07.prod.outlook.com (10.161.192.161) by BLUPR0701MB1938.namprd07.prod.outlook.com (10.163.121.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Thu, 28 Dec 2017 20:34:03 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:149) by SN4PR0701CA0023.outlook.office365.com (2603:10b6:803:28::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.366.8 via Frontend Transport; Thu, 28 Dec 2017 20:34:03 +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 BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.345.12 via Frontend Transport; Thu, 28 Dec 2017 20:33:42 +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; Thu, 28 Dec 2017 12:33:49 -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 vBSKXlSo002818; Thu, 28 Dec 2017 12:33:47 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id vBSKXkH1002814; Thu, 28 Dec 2017 12:33:46 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v2 07/37] qla2xxx: Replace GPDB with async ADISC command Date: Thu, 28 Dec 2017 12:33:15 -0800 Message-ID: <20171228203345.2702-8-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171228203345.2702-1-himanshu.madhani@cavium.com> References: <20171228203345.2702-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)(346002)(39850400004)(396003)(39380400002)(2980300002)(448002)(189003)(199004)(80596001)(86362001)(36756003)(47776003)(6666003)(1076002)(69596002)(85326001)(2950100002)(8936002)(50466002)(2906002)(305945005)(5660300001)(316002)(51416003)(16586007)(76176011)(48376002)(50226002)(42186006)(81166006)(59450400001)(81156014)(478600001)(110136005)(87636003)(356003)(72206003)(8676002)(54906003)(4326008)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1938; 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; BN1BFFO11FD006; 1:raOFIR362I5VMoSfZRmnarcYJHHosR+Uzl4vrgzadrhCb7p1Md16uxVGI0+MTdhnYWrfv71MyzqvP1tH3axNYI4qqzPHSrt54XvHQ5ljYW2JVFb4SC58pXX6Vwqq/gaJ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: abd26045-a01e-43d9-0be2-08d54e324970 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:BLUPR0701MB1938; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1938; 3:l7rCAB0r8qEXHTYup7ZBjessu6Ti+Dcjb6Idbz/df9VHa9b7jeel41okepihL/hGZxStN3OOkhvCZDs3FurN2O2dc89ZxNNFYoHGEgGaOKhsYUHi87sX48VD955JmWg2OJwczF2vnR5WJqUFgPrmr+B6AlPxir82DAZ4bBmR/Ir/coobewuPC5Y0w4klIB9zmHYk+Rsjg/TFd0Mgj9Bvq57CD5Au7ZOLm5mvUna3wvwVHToVzjFm2AG1BAgnKHSZHhiukeBa3iSJIS7NQonM2Ef8G4dIsk2p71FolJx2F8+9j2x/swPqsykGwzH8JBpPXA6fU5KgU3kYKI0h2rPgPw==; 25:CSSULLnNYCnv2P/wqhQvwrf6rs36BJP+1pw+Mnd8OzHBMVSpLi4pyuj7VuWuUmtxwxA1NFRGcb1R1n7JMx/igVK+kwhYWHTcscg6MPfCXHbqLXPq79FhTj2lSeh+5pbKWRIDGS13In9mdpcmgoKOfIB2px5sN9g9xcy0zlyplWTuXMZHm/Z7urRfVs1wuUuYud0EqOthVsBovxugDRsePV2g9A7/K+R59zfW60lCLgRrZEwXRC8OoOQPj3/iLU/BmBqkmLIF/ifAn8ptuM4S0Q93/D5fxZvwXFHhRB/h5aH5wiaCe13GgBaFW8hy4xz2icVIJ72zBTGAF88ey+t1frATJooV70F+Mdgwd7Bzq/M= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1938: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1938; 31:FAV8YjtYK0/LQl/aizwC9Bl45wwonvd8i9rG2yoUxCmFMZvs0ajegpfE2Obqw6ataynKpsOWNitIrXOpNUzNuVd7CTiM2ZP18mVY5QrNoFsa/BNieCEd/noauwfnmD4YW1OJ3JlJlUQxNZyUGusvbruwARpczYwb+2oQ3zLssY/HUxGt8CqSZOCBELbPCfzaEfTEAU5JB1+rLMBvFbGVOYVtvqDpq4TKvF2Gq5rg78U=; 20:5ru8pUSEbh4vYJkmqOYa+EEBp6P8nyTt1Bx0HjJHN+DB9kQh7K6e1G8YdnXWTzmnBo06P3M9EvGRk7VdOI7OUFrGDzptp9vKabDDziFJK3I41TgRbkrd54ITrWKstRCDpn6Ms8OxBinuSAVABi1Aovc6KwiGZ+6afot0hIoXXJcudJS+xUyc5U3iU5tfaQMtkuPtofYE+EH7pXoLw92kN2g4W6zPLa3DUWaTQDg9ow3iwd6mMwiKxS30VeDlF0dnQFhuHgT9jFNAVNVKczQrmmOpette6Nm8wPqR4j+oahWaEPfFSyLksDcY86cBPnXQZSmEzC1MptxqOsaJDS6D+xp+3sCVqWBo7t7Cvtftf28IrOwHF38REXbuDyLox9kIKtUVMY3D6RND1qPc2mwfnBOhy4bpHQEKya8kSS5ARSBTqeitK5ohA8iI8Bir7G26XzwCuIMj0NlMPcpBjZ8wJFeGzAOOrWUXa8rmjqApMiXoYYpCLDUFhsPZcXsHghm+ 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)(3231023)(944501075)(93006095)(93001095)(10201501046)(3002001)(6041268)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:BLUPR0701MB1938; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:BLUPR0701MB1938; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1938; 4:FPQgLRJ294rN9ztNfUuRuXVKFzufVWNpuGH5oU+rrg0ck1w3YxRwceI5Cw63L2C2D+RZYC03zEjpQbnD8Gdo///eClEMDwNCo/7y7QezG+eK1617hhE1pyvIKWFt39yBG540ug1vfKsSpDounaSFyw/IMB2FsCDuJ6uknv3pl93J3D0tMUpdfMS1QF5Yif3aPC1P7OeiXUxwTQBnLrSg4axMb2yGcmunJyKZpwBQg7i5hSa4BNan9giEuMS5B6PXAGi41UzcnEVOyaQFLMvIbdBq3XLxRa3pLPpun3Sg6jEL/iG84JzcjnBwBpnXaIAo X-Forefront-PRVS: 05352A48BE X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1938; 23:iNIbwOepSe4t9Mc2Rb80MzxwDPstQX2S+cn48xF?= =?us-ascii?Q?2BKn+EIjk3lTboiBXafWvSehStyJ/+nUor6Hz2dRuGpVLgEqYHP+t3TURKcQ?= =?us-ascii?Q?TM8EUfFR2BBsqjUUdkSNLZ/HPgV+QfzSvzpoo5/buvzbglXVFEeIxretrpIz?= =?us-ascii?Q?9pGiQ9bYQhcgyyjbhkK+/pj0Wv7tvhRx6esxeOXNroIdMpPchlvUsAaOAiMR?= =?us-ascii?Q?Bmnn6ydGMS5ozKCEn6EiZZqm7PlU0aQds71WRbpW1ayRGOlvYYeIi4AKrinR?= =?us-ascii?Q?vxPCN+6owcVdlItIkUXhLlq+3FNlHjvuV1M19iDL0B0tknVazevFElaHBAbx?= =?us-ascii?Q?1i5JT0hDimBa82RtytLyQCWFVtAgyChXN0WeWcbiXbPdiCMpREKjxjqJOOQM?= =?us-ascii?Q?cSdxjfPSB9OYpesmx9Whb/f/L08YpsLzJRlv+zBn0HaBLHP3ufbz/NzskjLL?= =?us-ascii?Q?/a07pi0Bs6diBBAN6kG8lqtTyLjgYRi4zLf7JEsRHoa1/k7Gp1QWcQB/ySRQ?= =?us-ascii?Q?jiOIToG9W1oWAGQy2MQa4mRuQ8CNjKWj8aoCvtM3+zQTKN9Eb0pqWIddSG7m?= =?us-ascii?Q?bcBJJCFxbtoCvglUPm9KspnE8LcPHpJYrY6/UXmZHrm1VGsdVc22dJRlcQhQ?= =?us-ascii?Q?MKc63OnqkRRvjdBOMQTLRI/LyTRf70yNKdSw0osukHULVmfrBxuScLQ+eqRX?= =?us-ascii?Q?8fwfW3xF33Efn33ctve4IrjP6dXEf+bj9SNhd1XpJtvg9ly2zjRuNzrB52BD?= =?us-ascii?Q?HiImJ60pNWJQ5e9XUrlLZqBQDQu1VyPcvdxfI7rmG2Be4HLhsryRINkGk5Vj?= =?us-ascii?Q?quowLiPkf3/iXITxY34LlPUJUr2MRWigVac+BdhjtNlH9ErCbt/MGbKJCR7u?= =?us-ascii?Q?ujNWES+cDP5oLO4Fzo2mJMiDVu8nAGIbhla9YlIQGg1F6NK1y5Lkeb7Onq+O?= =?us-ascii?Q?QPFFg9dH9aPzUqrT8CVjpfrwfKKvip5b2LP9eWJmoB6jjx6Z1vRuxKMaqwGK?= =?us-ascii?Q?HoHO6bhCo6s/ObNj4M9ysPybr?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1938; 6:0qf3XKu6kRySMajj4NDoz46RsPa/DGWZX3DFXJvLlnV0fSfk7nNg+AlujnC3LatUquO2CjvKBclYlcPC46UcL30wHEXgAWWS+oyuzXm6/GDoaQyrVXPuQaBLct9nN6fElSYXEUmSWzVx46hKapY/T2PJZkEv34Jc8bFkPRsNCfzwWe6+NCIDW4aPLowCsik4zAyQouCTYUHe8zXSEEdR+9O5Z81ysRuF82tH85qEH3V2EbviquLbZ8TVQvkSOd+j38u7lajrWlVZ2C7gjTFK1d0KeY3cJUK7mlvDQHg3PvEmoh7p9s0lWkwDMx+JZoVQHD9wvlkLV+x4ghJMub+tJpPIiQd+sivMqa8yLwIQQZA=; 5:I33+N+QJKhbEubBRCi3WU/EP8AP2k6APQdGxFRRaunOKja5gITzZ+PmCdTi3tKSQxaDJGDWpb1j1civnjIxTzgokWdZVtbhEfvsPcMIxm4SYEnQGFK4koHhS6SagbCr0hfTrjQOJ0m1cUIo8ZaZnonBTKpM5sSh2lozltK4496s=; 24:YZjX95gnNc6c0YgwruBu2iuE/UMHktgc/r16SUMXvuxu49b/1l5JclvxLUcz2UM1LJZOlSQJInLItR7bI+bIZiu/ZeZbsK6kBDZviUd50vU=; 7:A5D95ce0t5k1TCyT9i64M6asnmdeM/LAoI3fq6oK5r4255KceiAJE7Of+QQjtSJq8E2sA0U3s9B3v66CZOlCsp6zh71G4hYkYCGT3khi1PMFICaR8tT4FwSlfC6hAPVKMUg9XNSX5z6PssRaU4jKATQ/Zau9woZmErFZfz9yGtDOpOPCLPsZduVvFdDgD3NEFQz/idJD5rI8PZ1M21jFHXiwMp44ctes4UHkSkgLXk5GyAo7329lj0UJDMGAXyEv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Dec 2017 20:33:42.6772 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: abd26045-a01e-43d9-0be2-08d54e324970 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: BLUPR0701MB1938 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 | 65 ++++++++++++++++++++++------------------- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 043dd51a2760..ca2ad477a4df 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h @@ -2277,6 +2277,7 @@ enum discovery_state { DSC_GPSC, DSC_UPD_FCPORT, DSC_LOGIN_COMPLETE, + DSC_ADISC, DSC_DELETE_PEND, }; @@ -2303,6 +2304,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 07fe17a986b0..bb96219ce525 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -2823,15 +2823,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 */ @@ -3172,6 +3176,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", @@ -3246,8 +3251,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 fc307752b2f5..93d0077ba388 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); } @@ -319,15 +334,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 +884,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 +914,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 +954,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 +1013,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 +1031,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 +1266,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;