From patchwork Thu Sep 27 05:05:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F0E3616B1 for ; Thu, 27 Sep 2018 05:05:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF462B1E7 for ; Thu, 27 Sep 2018 05:05:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D20082B2B0; Thu, 27 Sep 2018 05:05:45 +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 303E02B1E7 for ; Thu, 27 Sep 2018 05:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726931AbeI0LWF (ORCPT ); Thu, 27 Sep 2018 07:22:05 -0400 Received: from mail-eopbgr680052.outbound.protection.outlook.com ([40.107.68.52]:25593 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726669AbeI0LWF (ORCPT ); Thu, 27 Sep 2018 07:22:05 -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:X-MS-Exchange-SenderADCheck; bh=mRmGiZJ2b2TilV4d68P8wYrFvs5ASSHzABf/f1BKN5E=; b=bF8X295Wsz2deQVxPkiFMaOOxNnhiX5YzIICQBbkHTWu3xX2zIryBjPSLJVVNuYoEmfW7i994GASIOL1tWkntgFZ34hcZtKgx5WufFc3qW07xXHJPt/4Pm3584/+uejbLcyA4z2UOEiGKXJ6Pp1J/Exegg/+3XpHaxfo8YoOA14= Received: from CO2PR07CA0070.namprd07.prod.outlook.com (2603:10b6:100::38) by BYAPR07MB4392.namprd07.prod.outlook.com (2603:10b6:a02:c0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Thu, 27 Sep 2018 05:05:39 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::209) by CO2PR07CA0070.outlook.office365.com (2603:10b6:100::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.20 via Frontend Transport; Thu, 27 Sep 2018 05:05:39 +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 DM3NAM05FT007.mail.protection.outlook.com (10.152.98.113) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1185.5 via Frontend Transport; Thu, 27 Sep 2018 05:05:39 +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; Wed, 26 Sep 2018 22:05:21 -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 w8R55Kpp007214; Wed, 26 Sep 2018 22:05:20 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55K0q007213; Wed, 26 Sep 2018 22:05:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 8/8] qla2xxx: Move log messages before issuing command to firmware Date: Wed, 26 Sep 2018 22:05:18 -0700 Message-ID: <20180927050518.7147-9-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180927050518.7147-1-himanshu.madhani@cavium.com> References: <20180927050518.7147-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)(39860400002)(136003)(346002)(376002)(2980300002)(438002)(189003)(199004)(54906003)(81166006)(81156014)(44832011)(42186006)(26005)(126002)(110136005)(476003)(2616005)(486006)(316002)(16586007)(51416003)(86362001)(2906002)(76176011)(336012)(34290500001)(106002)(186003)(36756003)(356003)(50466002)(8936002)(446003)(305945005)(11346002)(48376002)(50226002)(15650500001)(47776003)(1076002)(5660300001)(8676002)(106466001)(87636003)(4326008)(478600001)(80596001)(69596002)(72206003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4392;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;DM3NAM05FT007;1:Bw2O46nUd0+J+uoSlp+/tSiZsKDWd4Lb1M1tAOJSYSSorlEBdW+uROZcvPwqwtZ77t+VKNgfKrAVnYcrBzbVU9cjfttYAEqA/xC88ROoTFxCIrd0/p2DSUNcJNyn9HSk X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 717f57d8-cc89-4d8f-4193-08d62436de4e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4392; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;3:+EIe19d9PtW0wvs2mqjrftZ6sD+VOSMlirLbPqtQdZj7TqU1H5xxq2mtKA4ZSJ1Iz6KRLasY4tEdhsaQaX/h4vQIVeORJ/LCR3gISNiYTSTPZf8D9w8cpOnS38122N56A5Vfm3JGcL6JjymgKhT573mWE9siGlRdfl1x/2uUW5UVwB2+Cqebq58xrej9gE/zUdiWsyVHB+fRQKZrawYDD3o3VbVJwvN5KlpRT9WAGfGvEcuWVDvsmZ7bsZ4iI6G5h1K6RZBZ/HhScdf9cpRSeEHXl/JewEfiQEsCmmvrg+14FuiTFPaju4MyMWCbYGMOVwsI2uq1tyMAzakpXnrWVJhnLjeqOWLh8X3xi6QaCTQ=;25:zHM/PpwcFexiD9xmBdZUXg5rfwvEzhsrDwiAQIL/kLsJmJhP9jBoBZtgp0fPj3DXNhdIHXh7yhj1GwsgKUbRwt8OKByX7MNM8lwsNnclJw3Qn+XzjrbrnZvmKik1Mt546WLxgxVHkHEkkQDhbZ882jrw+doyQ0mc7L5e/cQf/5BUQDWohBp9VdSZVQtsFzfKVXM+5sN+teIOL+YrTmK4hxJwVvAH0+SHCJIi69RLf8BtZUXwDBk0r2z7KyRZ/A03HAaO641dpTCM4kjHJhLl459P+Cmabt0v1jS0ERaxiRQSBwsV5Ld9WV+VYMg2eoMfPj4t4JZsEv2Wu2z38rmMlA== X-MS-TrafficTypeDiagnostic: BYAPR07MB4392: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;31:Q+fpRcu26Z22BNf0Yt0VCSRjLoMCwiFY16kVrKrEjWb8QKivJ6QJlBj8AECfybzW34rHjvBDYwAA9i6FsQjW5o0kJJVL6i9sIoJAuXLls/vjo/2wAL+5WrmOEqtOBupP68STfTsdhnCVhX7sNFl/I65BkXFpho3uwcdKjIeEaCxbbvjAWa7BwlaQRtMLwkObHQ3l178PjmRM5UxUABTqp/ex4RvHFT5ArGDQT5GGdCw=;20:NWiNwwDxvx3dMSHoyzghbTgX8+qHxaYaToW4IZhBTf8K3tZytghF0KYKdHyHeROZP11yqqpXZUeS4479Y5SiRtyhl4UYPfokts6atJ0Qqa1Qa6Q1JoTaZB5ncxQn30ZYeC9Akk6quhtW+9EOnAY9UhCmjopXVKN6mdykJsEtCLb3lwlc2TipVeW/RcBIPCNasCnv00IsmuPL1xpJK6EFPtjNb9fl4GzZPDVlEwSZam+CMvP2rDqmRhkZvrdvIftyS2FbMfsnYioeuLVNyVFRWvwbWm2iO+7BcQqN+N0cgZ10Ld6IcYjJwJi+Y78+eEx50sLLgWkZF8kDpkTgwD7A2u1TNbN20bzKa1NY5xlNbn2zNUlBrQbF0uK5uJ4kRjQ071Q6eq8WiqFJF7TyeAvC1Yq3SLsJY41KwM0CEMIs99ILU2OuIIFzV3N+ORtya1p/1WGj3NLc67u3P7IV7DgyIsHoUjXTjE3pjWyKFWodUCMnDy7ojiCxvJqtPR+bkLZM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055)(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231355)(944501410)(52105095)(93006095)(93004095)(3002001)(149066)(150057)(6041310)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699051);SRVR:BYAPR07MB4392;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4392; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;4:k1MKQAsq+ep745uvLGPuiLzUWkZrIAQyEBP92T3DQ5CmUZDaDylH+WBou6/GDhIGNtMqIGCdDHPiLVYPxeKEB+q8nH1D3q5guqJDPvnwxjIrvzZjYNdy2PFRWe+1w65zH+NJyhCgGwNAPt4M0QTcFEEV8Jp4OVxEAU9T9eQoN2VOIFsb1kFKNWmMUMVM31gD4AQfCrSJRNJG/rGssRLm/jkrkawd29s0OCNy31cuqIG+x5S0DwtrCQFZmqdieO1a0+yav9GWNMSzDeHWTuaFcBELOFKtrThW5rPeNHccEqqcx6Edz0i0601grZXskeRqw/oRSjzk1sLH9Z5K5D8i/BnGn3TvI2c6X4kLZ/gZCnw= X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;23:39lxKwC635i8AcxFcM21CJSpuTEbD/7fnws5Q8dxQ1+GT5nl776Pd0N7qQOvXAjns2xw0JT+aZlE0I7VrtP7uPM6PV8x8mcTqJ3RlLlQ76giqRU5FnGs4pM89Rfjgd56A5B7b8WZBrvS0X/T9V4fNM2je5RsBW8MAzSldH8tPuMW0ikXaf634ZVikB1GEgmM0Kvn5J1chn0aLX6NurmBPiUC/nayB9MmNcaT111i3GSOXws9wwr+/NwVjJ6/NohxUN4YKijKqfj25tBlC97a5phNJQnELY84GMToa0p9bWITmnm52Y9rzo/gx98ix5u738B66SG9Lwdr+yAo52ghGBiQQ2ELyni2L6BsqOCjTEO/YYn+y7KxMppafswZamCr4M8c+u3oN/MCgC4NK5XhuSrhCzoGiprEJpe1zLUWH1/rcZRDDHcPq+5inkAFwD9iUKHPd4T/YwRppr1b5u9pyi84Y4C6ScRYf8pILy3/4cWYCl6rhfuDFq4jlVVkCbo81Z89ryJYRP1FzndHJYKC0Xv2i5AIEHO7Pg2hRUXEQS5haWjaM07/LdOVjsKLZbWYUFTSjug725O4F60YXpdXBBWyhXrpV3vt9AQoI0ukeI/i/xaxfDwYDxyEp6J9Tb5ltgwUk1xls5821WuGyFMtJgg798omY0j0veSEZleHofajho75WDSYXXn51uKD/onyoLU/Q0BK8vkgZBOahLw0rq/PY7WY3n2Y2G/EFQZGnaQvxQOMk9PabfWlLvL2Lzxpr4kSC9epuAB4jSTFW60xZ6TlFdwRSuhtzr1TOKDUbl4BLOvunXISjshlgOiTJnPsyufapg3gGZc+oDk0hUI99fKo62R2fCkJk5JUdY9Q4bK6cTz6Itu5ZaPGPhZ5+2mCB9CvOnaD8s8NUrsw52vMdEV3K4CfQmr6U7qxPTTWfJpxVrrWp+noV45nRf5/AMlud2wr02i4SJCkVrS78CGnGrKf0WmZVae+guumbxbiN6Nabf+03F35WIH21txPEw060QJFtw1+UsTjOv9M85FqZgCFJnr6pRcGN+Ne0AXqudarOOa4kzV0816OG4UaZKgrocTMFePlwQd8TiE1BjR56oMqExxcyebrA1DjMdp5X8Sc3uKCOn2RtfiIJuftJY5H X-Microsoft-Antispam-Message-Info: ncveBbhKckf4zOSvILwf0nt5+cK7PSEaxSEj52vruUTSoruDPMLSp96p4owOJyDFaSoYg4i6UXu78k4Y9qo7SOmf7phI8uKHYH7h1O7Ma4APvb6S80lyWTXS4SNelcSPcE0xDPSRIqmvxxJmdrsLx12QlsbeSzUTraktwl4WboechnoGaGhBY3MA+TjYjROr2hIWz3UN36+Qs8dELG0aQlIUx6nlMhVCNypKggr6rGfKYR3vbtyY3agroRgdbVT2nhlLDQpjMCNGgDKUe4F267mgotWnmwfGuPlsQxiVCzMwwu/QmHz+M+xNVuBCnSpxor4656tPUhtc4suSMm5SfVKPgrP8rIK5EZjG7CpJ9bo= X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4392;6:WrphSF/WH/bbUoAx0x+qMFvf0KvT79xtSePVgwxAAzCX/PDlMeWCrwo+afwNI1KNTmGPjgTPMyj5MenmTL514XNow31ZZkgM7DsrEkwwtXQ2rcuZCs7lQid6EDmSVO49qMfjlKoy7hNjf3moIji+aXdcBI+2/P5KpW2gTF7El6X4lec/pNVw49drUOlvjTCoD8FrNNqK0Snx+DJgwJfa0UDLhnhqpjnJfxU5+s3ayArr/YuqIW6MULcADBcba+zCWMhUE1Dsa1wb0m5F20K7zU3Mh7bssAX3J0rnOCIwxkHpW3FTJ+I4ZIlUovY2feVZrD6P8Mp8MdXpQo2t6ozVHDYta8aX6D7lIF5XGB4OZmpfvsbqXZdPq4TeBC45x0edPG8zJpr4xubUHmrvjjqX0wA7wuKJvrWFeyshAzQgTZrsFPGk6en7y3nyhc0d8GXvlgw+TfrzkHxgb5gIueMLBA==;5:qe+MvMaQ54+Ndi1vbxgzjZAUU5D+yd7Kfb3wnbcvIBBSkiqlNjykaVwMm8zsvatKDCXL0f9cH5iX/vZ8G4sOspMBNpeids5xq/mk1ATRfaFMEt6CDrZ04lqYMovIH3OpBM/bVUh4HJCFe3m67T8m5yUdCNHZ8fCNsj9kQoZxOho=;7:fizv91vJ72VzPMt9uDtqdKBKwbAxSLUAsXVb6EpLKXoIyhYDZ4SitpzQG4pfBQpvQgSxpk/2Ms9VBYLGkm2o5qcodO0OZHYFWd4i3GnNU/ifXJGk6eXl0YT966IrwZYUDwbtYHH6XGfuVwOyd/b5hKmI0dbrCc7K+qLeNWUTtxocS05gQTdqAergZiur6nJ9lMXSa1qdjffjMesjwPFbQkoAkErqnqyF9GEUluEtjUczEF6weXpNvNoM44Au6kMf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:39.3039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 717f57d8-cc89-4d8f-4193-08d62436de4e 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: BYAPR07MB4392 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: Giridhar Malavali There is a probability that the SRB structure might have been released by the time the debug log message dereferences it. This patch moved the log messages before the command is issued to the firmware to prevent unknown behavior and kernel crash Fixes: 726b85487067 ("qla2xxx: Add framework for async fabric discovery") Cc: Signed-off-by: Giridhar Malavali Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 15 +++++++------ drivers/scsi/qla2xxx/qla_init.c | 48 +++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index de3f2a097451..d4e7a5c43b43 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3358,15 +3358,15 @@ int qla24xx_async_gpsc(scsi_qla_host_t *vha, fc_port_t *fcport) sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->done = qla24xx_async_gpsc_sp_done; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; - ql_dbg(ql_dbg_disc, vha, 0x205e, "Async-%s %8phC hdl=%x loopid=%x portid=%02x%02x%02x.\n", sp->name, fcport->port_name, sp->handle, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa); + + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; return rval; done_free_sp: @@ -3727,13 +3727,14 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id) sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; sp->done = qla2x00_async_gpnid_sp_done; + ql_dbg(ql_dbg_disc, vha, 0x2067, + "Async-%s hdl=%x ID %3phC.\n", sp->name, + sp->handle, ct_req->req.port_id.port_id); + rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) goto done_free_sp; - ql_dbg(ql_dbg_disc, vha, 0x2067, - "Async-%s hdl=%x ID %3phC.\n", sp->name, - sp->handle, ct_req->req.port_id.port_id); return rval; done_free_sp: diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index afb6cd7b6800..0126e6c65f2e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -247,6 +247,12 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, } + ql_dbg(ql_dbg_disc, vha, 0x2072, + "Async-login - %8phC hdl=%x, loopid=%x portid=%02x%02x%02x " + "retries=%d.\n", fcport->port_name, sp->handle, fcport->loop_id, + fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, + fcport->login_retry); + rval = qla2x00_start_sp(sp); if (rval != QLA_SUCCESS) { fcport->flags |= FCF_LOGIN_NEEDED; @@ -254,11 +260,6 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport, goto done_free_sp; } - ql_dbg(ql_dbg_disc, vha, 0x2072, - "Async-login - %8phC hdl=%x, loopid=%x portid=%02x%02x%02x " - "retries=%d.\n", fcport->port_name, sp->handle, fcport->loop_id, - fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, - fcport->login_retry); return rval; done_free_sp: @@ -303,15 +304,16 @@ qla2x00_async_logout(struct scsi_qla_host *vha, fc_port_t *fcport) qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); sp->done = qla2x00_async_logout_sp_done; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; ql_dbg(ql_dbg_disc, vha, 0x2070, "Async-logout - hdl=%x loop-id=%x portid=%02x%02x%02x %8phC.\n", sp->handle, fcport->loop_id, fcport->d_id.b.domain, fcport->d_id.b.area, fcport->d_id.b.al_pa, fcport->port_name); + + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; return rval; done_free_sp: @@ -489,13 +491,15 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, sp->done = qla2x00_async_adisc_sp_done; if (data[1] & QLA_LOGIO_LOGIN_RETRIED) lio->u.logio.flags |= SRB_LOGIN_RETRIED; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; ql_dbg(ql_dbg_disc, vha, 0x206f, "Async-adisc - hdl=%x loopid=%x portid=%06x %8phC.\n", sp->handle, fcport->loop_id, fcport->d_id.b24, fcport->port_name); + + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; + return rval; done_free_sp: @@ -1158,14 +1162,13 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt) sp->done = qla24xx_async_gpdb_sp_done; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; - ql_dbg(ql_dbg_disc, vha, 0x20dc, "Async-%s %8phC hndl %x opt %x\n", sp->name, fcport->port_name, sp->handle, opt); + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; return rval; done_free_sp: @@ -1695,15 +1698,14 @@ qla2x00_async_tm_cmd(fc_port_t *fcport, uint32_t flags, uint32_t lun, tm_iocb->u.tmf.data = tag; sp->done = qla2x00_tmf_sp_done; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; - ql_dbg(ql_dbg_taskm, vha, 0x802f, "Async-tmf hdl=%x loop-id=%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); + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; wait_for_completion(&tm_iocb->u.tmf.comp); rval = tm_iocb->u.tmf.data; @@ -1787,14 +1789,14 @@ qla24xx_async_abort_cmd(srb_t *cmd_sp, bool wait) sp->done = qla24xx_abort_sp_done; - rval = qla2x00_start_sp(sp); - if (rval != QLA_SUCCESS) - goto done_free_sp; - ql_dbg(ql_dbg_async, vha, 0x507c, "Abort command issued - hdl=%x, target_id=%x\n", cmd_sp->handle, fcport->tgt_id); + rval = qla2x00_start_sp(sp); + if (rval != QLA_SUCCESS) + goto done_free_sp; + if (wait) { wait_for_completion(&abt_iocb->u.abt.comp); rval = abt_iocb->u.abt.comp_status == CS_COMPLETE ?