From patchwork Thu Sep 27 05:05:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617243 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 2683B180E for ; Thu, 27 Sep 2018 05:08:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 129842A431 for ; Thu, 27 Sep 2018 05:08:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03E792A4D5; Thu, 27 Sep 2018 05:08:21 +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 9672A2A431 for ; Thu, 27 Sep 2018 05:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726605AbeI0LYl (ORCPT ); Thu, 27 Sep 2018 07:24:41 -0400 Received: from mail-bl2nam02on0051.outbound.protection.outlook.com ([104.47.38.51]:9504 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726591AbeI0LYk (ORCPT ); Thu, 27 Sep 2018 07:24:40 -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=Qf0R3AUhW+zKVqBbOhzddqNms9ZAKfEf7XzGQAMIR4o=; b=PhJs6/ZYElXtsdXukpwTZKrLHYuOkmG1VfHwsMkLMOkpwYKsqkcgj61iLJTEtnlOMrrz5fZcHbhwq6jPLid+XHmGCryO+UX140CHNw2A4rVf6dTMhjfmqMvprVbtaskiwmXGJ8jszD80WL2830/BOYcfqvJ5Fblzq/LncLxKHPY= Received: from CO2PR07CA0052.namprd07.prod.outlook.com (2603:10b6:100::20) by BYAPR07MB4663.namprd07.prod.outlook.com (2603:10b6:a02:f1::21) 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:24 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR07CA0052.outlook.office365.com (2603:10b6:100::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Thu, 27 Sep 2018 05:05:24 +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:24 +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:20 -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 w8R55Jtd007186; Wed, 26 Sep 2018 22:05:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55J7D007185; Wed, 26 Sep 2018 22:05:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 1/8] qla2xxx: fix nvme session hang on unload Date: Wed, 26 Sep 2018 22:05:11 -0700 Message-ID: <20180927050518.7147-2-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)(346002)(39860400002)(376002)(136003)(2980300002)(438002)(189003)(199004)(8676002)(305945005)(336012)(106466001)(76176011)(186003)(2616005)(486006)(72206003)(51416003)(106002)(42186006)(110136005)(54906003)(16586007)(575784001)(50466002)(6666003)(86362001)(5660300001)(50226002)(2906002)(356003)(1076002)(8936002)(48376002)(14444005)(4326008)(47776003)(11346002)(34290500001)(476003)(26005)(81166006)(81156014)(44832011)(87636003)(446003)(126002)(478600001)(80596001)(69596002)(316002)(36756003);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4663;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:U68FcvT6B2w9nDNMjyQI4NHUsNr7JzywD5SJe1stGfQWOc+lD9GmgzLV3OLSOSfPNblZSssaoWjuTsxbAAys9SyOwGpQRcMM9Xlbu8v6J5fJ04Y/+4yG2xv05VyqbTDL X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fb9ef11-72ad-45d7-707b-08d62436d570 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4663; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4663;3:TqqnOTTq2tv18CWtMmvICf/Jy06LS5U+KUq8/Lm3VvrR29FDeut0QtGtEGBNDryS9vM8tlpD82iCVc7nss+mDCHmGjFTeTZ80BEWNbLroNfgRyX7NjgxSvmE5FZoa5+mRaB1v1K4ZQJK7hO/Eznkunp/TlX1FaCgLfZcEEzwtK9PO0tspawI3Y1QAUqc3BwEXaBT4aIRPOFLJbUGz85QwX3nb0MaYB6kaEwGw++mZwLqJlmjr/+KARu8sJmCn0wHco6Smqwp9LAAKJkTucdVwvaolm/yd1IJvvDmuyEmprKl8aFLb0Yq3ZLlKChoyN4lPhiznpatNl75IGrhRuW6TqtImOqjU17BO+g+GAyY8/s=;25:SvzQRB/nHqitaSR51HQbqjaKIkymfg0NsGb+BtbWVCzHgzGJ6I9LStcMeXzV2NHzCB9LNLpzB+MURB9eZ8fV1PjqpRJusf84QX0hs5AyVcDpk8MwEx5Twi6hn72rgJIUNGrYvN/Xz76k1v9jQaE4oGb/tqYLGTZ9/UvrLvQmpqbJmnlFlDJJyVUmbZtyFuUs1YSArvwBLRnuOWyGyxDXoNmQbEr7RLOqh7ianh7V5+ExRcZik1X4kap8rx/ODyKuMvfTO1H1R1rZTPSP9WqYkLG0nO8xBh4eEqHgh4GFbpOLR0HqOfqEAO5Ie5t3HVMuSCb1FDOXS4gxewBDhZblRw== X-MS-TrafficTypeDiagnostic: BYAPR07MB4663: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4663;31:5xvousIzHRYfwlgrG9XtVCf0ZolEFAXhpR4TfEZyD7Iqi1Tflfa0Iz088u9dkWXXuYB++UrVfxfa9UlmFMbVKAJ0ylNzW+s/S6JqOQFwV7Fa8nPrhWJ0sxSKLLjE7Tx148kmsA0rj3JGJXnPmYeMhrvKOeMT2nc9iuFURAZ3zb3aJOjKtXWMloINHlJICfk9p5Qi2Vh1Q/GvUlYoNHoZX6t4b7D2w4l395N94MV2A3Q=;20:aVuVosXT7+vkw2A+2tzYXekWDdwk+5lbfZ6RKeznmKLHqGy8Oil3ZtCrU3N8ArkuUHTxbNkM2jeZq6OS9wdv/ugYDXOL96HgqyKjiB3a5t/qx01fOyFj73Rrvrd0/camjtPWlTsAFUI7ZsHOgQDgUMg4Ng/hLpMTehEEAGjzzWl4gYat3/0xYRbwPYlUQhWSvSNL+D3qML8l88Dq6DLiBNsIZKLSmIQMnllb4q/cYLxOKL75GRB4bAFVK6//9dEZAKPfiQctqQTD8ERIG1llCWx6aA1pOCpsMh9D+R7eQ+WYdZKYnkFNsnTz4CUlsv96pc6PtSJbLJ8zdpxFTQ/X+l8ClBHepAoMkvl9zAh4vu8hIKuofiBfw6f6mw43vvtHsD1G4+1fRwPNUBw2hXvV9Mz6htS31tQThQrgqBytEqJOjE0Ep//kM0f4Ymm58VeWQmWWz44n42kG73GclpL0PvLGVGyAKlZHntuZJ1gL7Mc/orUc0ac1Z8v63UJMwCAq X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231355)(944501410)(52105095)(93006095)(93004095)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051);SRVR:BYAPR07MB4663;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4663; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4663;4:1Gtmd4a04xkyZFYTx7CdyDzO1MqVSS4YW2CQt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gbn9TmEvF+hcA7mV4jjWvIuul8H0jW2xZrfvUnjxaLRj1D7bLXX3UPCA7ebLwRExQflXrB7voaMvOXIzR3AakpeeeE4+2ErpkP6syt6SwSA6ESxMNn1Ft5gZTqgS16XcOc8XhHYENmrADKsoyPI4qfBwKdE9I8PtCJrw/6Jq3UKS9W4oa2NJiyaeJLyU2MswvOd3d0LhyHydI7cYaXaha4JYdlPpogVnPW5Is7F/5eWtpNGjpGgUrEFQr3fO9h/VkagbSyL9V9QUYPN8IHjFmlhEdnt1noCA==;5:ihiMbnIhgH3aN7Vj1SotEzR6+d/JkqSzYaaYiqQWCzlKI/ophMVLFsaKgBf2xlfFyozNoGr786M3HuiIBevRobZyJ91bS3BEcE67ApoYpy4TrVlZMUe1UHhPrIqhGViUT1gcZT3WJunBXjWdGV6822HEcqKXBiyqJ8GynpSkQRk=;7:2+Jx4fTuzMQjaKIjTxpPNNcrjDMPNRYJm7sZHQ05eBtHHqm5HJf+Z02h82+8Cokb4ImcmRLR4DHnmNzkAj1MDOehcp2iu0NfHEu8BeibAYomAHBY7+tRQFwo2Df5C55sR0QehfPQxiClS23ta+xXFchT2SO2ciETvcFwUAGttMfE1P3tjB9/s0LbXXgX/m/+A8tYzfLqToVlGFg0sUxDGiUQxZCMIurQFqerFFQQV72v2IQar9KGbK1Md++bzZWs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:24.4284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fb9ef11-72ad-45d7-707b-08d62436d570 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: BYAPR07MB4663 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 Send aborts only when chip is active. Fixes: 623ee824e579 ("scsi: qla2xxx: Fix FC-NVMe IO abort during driver reset") Cc: # 4.14 Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 20d9dc39f0fb..8dc7a5c64800 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -607,7 +607,7 @@ void qla_nvme_abort(struct qla_hw_data *ha, struct srb *sp, int res) { int rval; - if (!test_bit(ABORT_ISP_ACTIVE, &sp->vha->dpc_flags)) { + if (ha->flags.fw_started) { rval = ha->isp_ops->abort_command(sp); if (!rval && !qla_nvme_wait_on_command(sp)) ql_log(ql_log_warn, NULL, 0x2112, From patchwork Thu Sep 27 05:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617231 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 4FD94180E for ; Thu, 27 Sep 2018 05:05:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DF652B199 for ; Thu, 27 Sep 2018 05:05:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3221A2B1D7; Thu, 27 Sep 2018 05:05: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=-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 950A52B199 for ; Thu, 27 Sep 2018 05:05:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726629AbeI0LVu (ORCPT ); Thu, 27 Sep 2018 07:21:50 -0400 Received: from mail-eopbgr710083.outbound.protection.outlook.com ([40.107.71.83]:48384 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726469AbeI0LVu (ORCPT ); Thu, 27 Sep 2018 07:21:50 -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=Xursu58qjXRXkdS4VB/DTH/vjn5dLHgMkAYBg3Ejwyg=; b=A2wcCRCdrqcrb1mWq5s8Xz5SqdwyPi6nDjtNOuEpWvi8Cyre2z0bAet0pgOklnrnlOTRG661wmMd2tTWy5F0eQkZnwQW6iuDGohI63PMgs+tKmvsIy07GsCOXfQ/JhM+0EOiDn3NeQqcQ/nX/+jFv2ABaX18iZ6YIcTNQn5QMZQ= Received: from CO2PR07CA0059.namprd07.prod.outlook.com (2603:10b6:100::27) by SN6PR07MB4400.namprd07.prod.outlook.com (2603:10b6:805:58::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Thu, 27 Sep 2018 05:05:28 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR07CA0059.outlook.office365.com (2603:10b6:100::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Thu, 27 Sep 2018 05:05:27 +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:27 +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:20 -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 w8R55JDR007190; Wed, 26 Sep 2018 22:05:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55JHN007189; Wed, 26 Sep 2018 22:05:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 2/8] qla2xxx: Fix NVMe Target discovery Date: Wed, 26 Sep 2018 22:05:12 -0700 Message-ID: <20180927050518.7147-3-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)(376002)(396003)(39860400002)(346002)(136003)(2980300002)(438002)(199004)(189003)(44832011)(26005)(186003)(87636003)(4326008)(47776003)(575784001)(86362001)(51416003)(34290500001)(36756003)(1076002)(478600001)(106002)(50466002)(48376002)(72206003)(69596002)(486006)(80596001)(50226002)(8676002)(11346002)(316002)(446003)(42186006)(8936002)(2616005)(16586007)(76176011)(5660300001)(81156014)(126002)(2906002)(476003)(81166006)(6666003)(305945005)(110136005)(356003)(54906003)(336012)(106466001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4400;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT007;1:oeiR6HmeiTL1LB1ouJj0whByUEjvOpK4Zn5F6crMwQcSctVD1hCafNTNhpkAiIWbCl9POWRdBHfY/kS6l9TQldTzFyho/eY/8vSo7UnD8t5Oi3sZTfmUdAK82Yi3XpUc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 969d0f42-f934-499b-368c-08d62436d759 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4400; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4400;3:7/lNX3SY1VUdm5P8yNaToqamQfb3Apdg/bZL7/JqDAroSYRFmRmWTNLHW+NM+5ixglhRyPY1JokyNYQueKZXclZXgqfVaHu2CmFghM5tBGDethuKT9XV1vLnl8jj3IdIx/RtpZ3FKMJc2Q2m3nCqpJNAJUGXcZzW995YKY5ZXxak6sarUFrXswQqcGcHXFCf63bCzBxsT6HFL9FBLTuywB3r2FnGcwnUO9wpaI/ak6Bv2ydlBOZCLIs1i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CXGoa4hQk1MaD4fyir4g+KAq/xX9PhSzVnatoEOfUtYAXA63euIqqBuuqJHYxXTubwPM1Nry009KIz9TD2SLyrjFA7+y82ArT07IF4F3UeOZ0pmUTPP7Kr0M7GIhyLMKMyquYY7tyW5ffwirkMFjWmzLPc5oX7OLydE75A170hj4qgE+PSWh4xsW5mLPBnG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93004095)(149066)(150057)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(201708071742011)(7699051);SRVR:SN6PR07MB4400;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4400; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4400;4:LpZyMvZCgN9ZmFjzMrdEhHgKmQrg9oHVIhXqMmqsJ90GNodFXF7gl8iKVUKsBcfbbtG69U9l1uLjqDcN3Zp87pJPUFt67PZXHO4jg+1OmTILOmPEHVPawGkfpOBcd4cPMd+d4eDj/A4f0N0bwjqB+nCKHtVUdPyc6Sj7zeUJC/nWKrf/rIVLS/sQRQ3ajQGRtn6pXdpPcwnV+EpeWISKB6NEimCZSson8zcXMAjbdfQMs1IjdSqXhplxDHt3/BdXtHQk23Ralt8IMskOwnoQkRnTeI6z+1K3+RqtDc88seOthZ+m50p4yd3EUbiTuC2F X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4400;23:0u7PtFih0IPlLyX9rmzW6a/7ZQ/c81xQfrnrHEkIqy9/0Rc8BR1gUq8gdk7aKeuVgIGkjbbjI47bQsPptbXQWXi5pwV9U3BYTNxgb0ZlK2fZ1BeeElmiWcDq3lDr3rwVx7GRva4Q4N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zbskC/FRhbEvaUQtzoULOZM8VB6jM/8NW7ba5N/D8fSjWZi4LJ+qfxoMzkUog4Lkjr2DA3D2BmbULKYjfhyD7YxFHr8ITSO+DdfknYODr8XRenb9SHmRvku05TIvzTawP7JHq5+0uOOJlEM82oHCY0yVvCFal6byj1ARNaQ2kxzL5YnhUQdYovUmU0VMVf2YdYMIf4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:27.6317 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 969d0f42-f934-499b-368c-08d62436d759 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: SN6PR07MB4400 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 This patch fixes issue when remoteport registers itself as both FCP and FC-NVMe with the switch, driver will pick FC-NVMe personality as default when scanning for targets. Driver was using comaprative operator instead of bitwise operator to check for fc4_type for both FCP and FC-NVME. Fixes: 2b5b96473efc ("scsi: qla2xxx: Fix FC-NVMe LUN discovery") Cc: Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 42b8f0d3e580..ae9fd2d01004 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -4808,10 +4808,10 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->d_id = e->u.new_sess.id; fcport->flags |= FCF_FABRIC_DEVICE; fcport->fw_login_state = DSC_LS_PLOGI_PEND; - if (e->u.new_sess.fc4_type == FS_FC4TYPE_FCP) + if (e->u.new_sess.fc4_type & FS_FC4TYPE_FCP) fcport->fc4_type = FC4_TYPE_FCP_SCSI; - if (e->u.new_sess.fc4_type == FS_FC4TYPE_NVME) { + if (e->u.new_sess.fc4_type & FS_FC4TYPE_NVME) { fcport->fc4_type = FC4_TYPE_OTHER; fcport->fc4f_nvme = FC4_TYPE_NVME; } From patchwork Thu Sep 27 05:05:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617233 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 3807516B1 for ; Thu, 27 Sep 2018 05:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25B2B2B199 for ; Thu, 27 Sep 2018 05:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 198622B1D7; Thu, 27 Sep 2018 05:05:34 +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 9D5162B199 for ; Thu, 27 Sep 2018 05:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726641AbeI0LVx (ORCPT ); Thu, 27 Sep 2018 07:21:53 -0400 Received: from mail-sn1nam02on0084.outbound.protection.outlook.com ([104.47.36.84]:37320 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726469AbeI0LVx (ORCPT ); Thu, 27 Sep 2018 07:21:53 -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=DpoUKkn4oAU9NxbBQedYpJpTZA5wa77yUBYOVG8kgOk=; b=KPgvB9Pk24N48Ge2rlMreB7mjpXSRvs1yh2PtyGKsHMxKDPD56gu9PsXgzaoGCAX/I9gNYgK133HQAdW7COmQHIyX75sUi83CmbvwEhgq2e/vSyjnq6KSv6OeKYgtnk8R8NVB3hnwcQBjZLsQz+PCeKwt8KkOzG9gnW8Joxai8I= Received: from CO2PR07CA0059.namprd07.prod.outlook.com (2603:10b6:100::27) by BY2PR07MB1443.namprd07.prod.outlook.com (2a01:111:e400:515f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Thu, 27 Sep 2018 05:05:30 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR07CA0059.outlook.office365.com (2603:10b6:100::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Thu, 27 Sep 2018 05:05:30 +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:29 +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:20 -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 w8R55JRF007194; Wed, 26 Sep 2018 22:05:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55Jjg007193; Wed, 26 Sep 2018 22:05:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 3/8] qla2xxx: Fix duplicate switch database entries Date: Wed, 26 Sep 2018 22:05:13 -0700 Message-ID: <20180927050518.7147-4-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)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(438002)(199004)(189003)(76176011)(47776003)(126002)(48376002)(50466002)(80596001)(106002)(336012)(1076002)(69596002)(486006)(356003)(42186006)(476003)(51416003)(8936002)(86362001)(316002)(50226002)(44832011)(81166006)(8676002)(72206003)(26005)(4326008)(11346002)(2616005)(16586007)(87636003)(36756003)(81156014)(478600001)(2906002)(446003)(305945005)(6666003)(5660300001)(110136005)(54906003)(106466001)(34290500001)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR07MB1443;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Pass;LANG:en;PTR:50-232-66-26-static.hfc.comcastbusiness.net;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;DM3NAM05FT007;1:wC2yvUrOiWP5LeyWJ6858ixed5s182ywR8I0g99BIioTIR8Ml2compcUv56kDfZfJgA14xs56nQ/7ADgu+914BEQ8mFqZC50wBWM284cBNVAZ7hZnwot8JffXJyAs4On X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d45320d-bec6-4b95-034e-08d62436d8a7 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BY2PR07MB1443; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1443;3:6b572DBIQiNODn0X4ZqlIfgQ0CSBigF0qRdLLKM/D3ZRJSqLTjg84iw2VmILR7pda3Ku4KMfFuzDPAMrvS6+WI4Tc4iSQcUtkLs1/R2CTf7xJLHAhJp61X/rJdpGn+aUCJE+eXp/07dL+VSs7rQlQiUz1LwLzIsvDPj55uv2nOKkZYQfaZHlu6onskFAqS5dW+IdE5R21CI6lrDzA3TaTeRJNw6gSu+zubpYzwZezoP0mSzf7oPOrXIPLM4hDKXMFeLXQzWw/9AtZrOp0Kqc/wq7CaNBGpoXCsJlnRFcI5VlZ29R0JerHdxzf2SP9Mpj9vaPylG/d0ln6aHQrKuS77D36LlfGdulQPtibz0hA5Q=;25:QoiN5VqEHyhRipiQ1ddg1XL/GoLoGlZGPMFh62A3cDOqhwrFOCq5PPdRkEnK88gwbf0ppaiH2ABKAvc1Eo02BEAYqrMy9DBATDxCHy9cxOhT/BD5BLSMo7fg9ovqfGXjqjVrqpQ9G3OZ6SKj6TJnORIYtfAN9FVrOgtRdRNRUG0cA2j9mj7UwDg4JRwlBveQQzzY9lU+wagJjSqY0Vm+4rJuguCKInkkhaA+Hh5aDK9c0KdkumCFmREL3LhWry7PknNSFZshBz/IIazaucwNPGrE2PFs5KJPNwBv9PAE8mWB8X3V8A3UBrb5Ftz3ulMavpRwON6fExu46riHBSbngA== X-MS-TrafficTypeDiagnostic: BY2PR07MB1443: X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1443;31:/Gxv4Kea13ui96x8nv5giR0g0UI6vX6b8luaKQqpwVL+cYUcfV2GqtKMFR69RHaFPkQuW5MZyn/FjvB27l6zlQcRVKewnCsF23f7R0hmU02c2A/tGN2IgEIFrQr5JXIM3mdig9xjpR0lnbPunJT/9GwY3KzMIIXDDWYlSaBHfscrYYEYxX1uCgmhM4oogCConBtqy6K+O02xWA2/cK+vs8OIrid+J/j3kJQfp8xLP1M=;20:iXq7xiTbaug8AyqipgqjFM15oDnWHjUF/4XK5q9Bu5Qu/Q81saar2UbKpHk4QyvXprrzBX/9pKvU8A6guDWaQOPC70FAJ7aMBZdj0Ckjfb2R79cfkHiXjGmTqK94sz6+WDVMTbxCw0Cnq954D8jrL84Vohc6fgmTC8LxYe4c+PjJ1UqS3367dnk1X4TEifR6XSdZ4+0LPuq3NxlH7nbEMS6tFKenYifcYc1+KZ1Yts+aNhN1p6Qf1ihN3QOm34OzlU3afFn+uQma8cQB3Xx1Yda2hEurl2oJ53X1aCec/PLlCR6/PWEvsLcFpUQKq+aQqrNEO5Pag9/nHpRgrR732wThQqX7RVBf9Aq1ZefP10M15Iwye/GGL6Q/qNwCr6XZ8prC7O/zoMAGGvsG8SFEiuEiVKCEqgytqKw8JveZW6RdoqLJkRJvYnuacvzMs9PNvDr9jZDNuUShPhslFVZ6I87DWzxGAutN/atJja6nwZAN6UVk5dDaMCPRt5S/sQJg X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93004095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051);SRVR:BY2PR07MB1443;BCL:0;PCL:0;RULEID:;SRVR:BY2PR07MB1443; X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1443;4:RD4aJl42I01Ivjox2+CYmjw5a8SrPXZ9caczh9Z+gee/VpBkhqXC9pQXKBrtblKFpzsRM+s8KXlFZc1fiLFOeM37iuj2wlEbL/3PUI/dRFWnD3EjIC4lZ/Hm5W6jrqWT/2FyUhPcIhl3+ZujeqZpKsNTgbPjIv9VDbBDFteyZSgSyQwwslsPZCdzr40Tz2u4fdrbDGdem4qlvTK3BSI71VQErNohj8EWTlvR18VPj3ck+RxRrcNb/ksWug2QWY8iErsDQxQry1aGzQfq6Wy5rzGQBSzFjQ6/rUYQokU9OBAEUHAnCnzz5kzTmitsC9J+ X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;BY2PR07MB1443;23:dBeG60aN4/+bWtrZzQE0+QB7K9PX4UvOPDBVS/BylVxYSNZ1g/FpPcjvCapQDuOgtG0j68Qp/JNJrT6er0cMiKJhJRN24vo5MkzZV3+2jya/q+kCgCI3YBSRvAkN41XRgnVU2Vs/D6kNqG5rN4T6QGgcOGokSb3bUPaLb8ZqpS77ELTlfWd27JhL8qI1iNnk+PeF2cDpo0+NsrT8gM+BzMYlkcqYa3R6KecsypAU1KMiT7xeXnhhi+HZ9AZZuwmYZh5F7u3APinuSJMJvd+PL8pDgRINfUHGyjCHZiexlcynFJAd4YzsnjlQpC9YbQ9nQJRZaYZhWd/WXdOp5iBSSLYR5edF00fn+R9QG/VZHzWQ1UPJpr3LfcC6T7EVkfoeWajJddri9izZ04vsdPPAdEHyrBESeafr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alTime: 27 Sep 2018 05:05:29.8192 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6d45320d-bec6-4b95-034e-08d62436d8a7 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: BY2PR07MB1443 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 The response data buffer used in switch scan is reused 4 times. (For example, for commands GPN_FT, GNN_FT for FCP and FC-NVME) Before driver reuses this buffer, clear it to prevent duplicate entries in our database. Fixes: a4239945b8ad1 ("scsi: qla2xxx: Add switch command to simplify fabric discovery" Cc: Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_gs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index a0038d879b9d..e22c038e47a8 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -4444,9 +4444,9 @@ int qla24xx_async_gpnft(scsi_qla_host_t *vha, u8 fc4_type, srb_t *sp) sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); - rspsz = sizeof(struct ct_sns_gpnft_rsp) + - ((vha->hw->max_fibre_devices - 1) * - sizeof(struct ct_sns_gpn_ft_data)); + rspsz = sp->u.iocb_cmd.u.ctarg.rsp_size; + memset(sp->u.iocb_cmd.u.ctarg.rsp, 0, sp->u.iocb_cmd.u.ctarg.rsp_size); + memset(sp->u.iocb_cmd.u.ctarg.req, 0, sp->u.iocb_cmd.u.ctarg.req_size); ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req; /* CT_IU preamble */ From patchwork Thu Sep 27 05:05:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617269 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 EB804174A for ; Thu, 27 Sep 2018 05:24:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D524B2AC43 for ; Thu, 27 Sep 2018 05:24:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C705A2AC6E; Thu, 27 Sep 2018 05:24:49 +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 45F122AC43 for ; Thu, 27 Sep 2018 05:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726669AbeI0LlN (ORCPT ); Thu, 27 Sep 2018 07:41:13 -0400 Received: from mail-eopbgr680051.outbound.protection.outlook.com ([40.107.68.51]:8023 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726654AbeI0LlN (ORCPT ); Thu, 27 Sep 2018 07:41:13 -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=+LyfEM9xJHYxK6cpYy5YoePu8BTKrhpF7T+IJJ8lDdU=; b=lB0fAQ7PexPm9oSHbt++do6FR8RXSPT9K1HwYktw6M3qtAtqF1kCBmhgciz4/UBeCLrCr7ytFGHkyNnnvrBYlHcDI4moM8A8nTnxUEjgxENsfEaJmPxP5mehe7U+s8/DvPtW1GDFgxlBHzXoN9GkIZpDVTqzRdQ5uk5L/RaA0j4= Received: from CO2PR07CA0059.namprd07.prod.outlook.com (2603:10b6:100::27) by BYAPR07MB4661.namprd07.prod.outlook.com (2603:10b6:a02:f1::19) 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:32 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR07CA0059.outlook.office365.com (2603:10b6:100::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Thu, 27 Sep 2018 05:05:32 +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:32 +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:20 -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 w8R55J8f007198; Wed, 26 Sep 2018 22:05:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55JPW007197; Wed, 26 Sep 2018 22:05:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 4/8] qla2xxx: Fix re-using LoopID when handle is in use Date: Wed, 26 Sep 2018 22:05:14 -0700 Message-ID: <20180927050518.7147-5-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)(136003)(396003)(346002)(376002)(39860400002)(2980300002)(438002)(189003)(199004)(72206003)(4326008)(47776003)(5660300001)(356003)(14444005)(51416003)(76176011)(1076002)(305945005)(16586007)(8676002)(87636003)(478600001)(316002)(42186006)(110136005)(54906003)(106002)(50226002)(81166006)(81156014)(186003)(2906002)(50466002)(8936002)(6666003)(336012)(48376002)(36756003)(34290500001)(80596001)(11346002)(446003)(2616005)(126002)(69596002)(476003)(44832011)(26005)(86362001)(106466001)(486006);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4661;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:Ujpth6ftt9lATsTirj/5mKbps4OdsAI/DI4ywrNu555Bfs5qrcj4FL7u07DMuGE2Y6LcNjFMDefhQlptkRPgbULhDuzm41Jw6B4q+xTJNJmXppmL1dw0nJ7YZOLTKgPA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6eb2fad5-5a7b-42ca-e044-08d62436da26 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4661; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4661;3:dX9rzgUlGFr7roHO/MPGgf+Ia/FHQ3FFhMRQTIBuSUbK/I+y7QZYaA0Ma2os1CghgljWJRkhSwQKRdAY5iPpAMAnHX+6dzy7HW0HaouVSoPbkmNp6YznErawCUQyuRfDsMnouvUFgDTYrZbJAKvAED7YcR3hJiEcYRT/GQyK5Mqh0jU6puNbHu0nIfirmIJZ2OfTUzuDbkV1iBYkh9ifcHiuWIgAqPtEFOULprvI+JnREJ3zWSMQhz5p1KdpVVhea/Gyr//oVOasC3j4YyPBwpGeUoeLO6b0vOOsF5n7MtPIXwoq2hz1nRd1dbwrt18vNZAM2E5oPzyDnb/VzC+THj7EaMD374vkGxBRQrZbZUk=;25:gdRloxLTbAzpCzHClFF+45Qe/wFWmq1YgVXwY02bo+yfHmCUirjuurSBCq2UuYL1sm0OeKFg9Nqb/rwa9XA7Zde3VqtfOetlOgnpGRJcIiNg9ncOY+44H4ZokEZc3fowYdwcLD8xdPMbdb2O6QTDRtUniZDG5gy8h+MAt50ZaIN/jrcZ0IqfUHxTWHekgildvtwfMVUyxhN8RxShh03KS6puYYqH7CrMOc/tanNk73tTFPFLNzesf/6NpSyWHVFOssrTEhynHJld8Tj5fY20g3x1nw53idgHNAbe2+4+D+FunosWGokPRm4DjNpzFUqQ7yuaLfBqOMppUo3rDMAYIw== X-MS-TrafficTypeDiagnostic: BYAPR07MB4661: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4661;31:zTUo8p8XQcCu3zxoCdCH6evVIhSL5oohsgqYWFVWIjVfotgxyZrSraS8pRecE/7/y0txv1SIuWmwwCqKzJmbKi3j0V3vyxv+rrqrMdxizWBSz3Jtxk8MWafZzByn5cuTBm2NjE6ETgXmpqtWhZPnX7tWFwZjxu9F0gOi4gVON+mw+gpzTVaJSfbg4m1NUpmYNZsdyioOaCNCLkOyE+Z3IAXrBx6w7yZ2LS81tt7tfsU=;20:MZU7QozGyfI3w0tRf7NOsDWpg0YENy6RTS7UETloEarx6G+umOCIV5Cjxfz4cmknGsq0plLj56criptnxB+A1m6SQajjNtmjIp1SLW9QdYxkw9qRgxTqXly2AHh1aFyRr8/UpRsKoS3cBLPG2gsIT3GCimytdau4RF4uuHsri7dLXOqO2/2OfKeEMZIbtDpg+MhlsT1FRbCoazZW8TGFi8pM6QpCAzGSV0DzLQtHmdOGj3A+gINHzrDaLWUHzsXmHyJlLa20x89oCZrvN5zvadP41H7GpMeKtnpEnsHm53OR90tWRxnQPEJsmXbeWfsGamc4j96ET1muWKORYSmIJyp5102fL4uVekj3wPwM/AvPBu1bUI+0pXI5jm2kYj54abTBGfojWAj4vhNGEeJ3sEoHTWUrq2juy5begnv3gkrUbfFfBMkHjooUqS/AoTsnpY9CLRalm8wZO/wEv1kvmGWVo+x6xih+78BE/vhLdgRSlP8OT9Z0SdjvME2fB5n7 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)(3002001)(10201501046)(3231355)(944501410)(52105095)(93006095)(93004095)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051);SRVR:BYAPR07MB4661;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4661; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4661;4:GNagX20iwb0/Mz4yp4bx/a39vp1dAoSKUSWnQGuxsbav4bzyZfJ+WZeyJfo45OhOM+3GBnRV+TLHoigHc7Dc0gYoogdzBp5CqHEGEWBkSs1VHnHJsm95MTMFNi5F6qesDE3IQewZU/YgSeowIuptATlekHOfCO3bSD6g8apKg1du1C6hELXFOEOYpx9alDkQVNkhSRwuZ6Q7ITbSE2dXSXDrJsbJtMapJlL8iTCC43P/chvlEC7eOwFlK8i6zyy/bsfU24Xol8qYiSrXKZVLGz8Yukw3XLebxWWwuXtswBbbO7zVcpsVnCE/q4qC7Kqyt7j6EHmqL1deoi6u3x4bTA/NQzYvk29KUjy9tqsgplg= X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4661;23:zd/oSjYd1jDRwzqPjL9l6BYDXdcFNcGzKN5bysH/he241kVL0r6VOt72ZvaGt3tCnS7nZKoIl337MgVkeUKGOYSudoSidO14sdb/rMge+sPZL4AMZMx5qVg2OCtvBQdnfMOyeik7hOeTpVVf38WTF1Vkm00hFLPI0XNFjI2d+BXaXiy15IKSRGy62wKOxP/1ULQ9roiDAs6mcHnLHJEs2Qrqxyvt79qP7c8nF8eIvU/N4CDbvy2yUHp/AiGbPpM80IHYVv7SiEx137f5GSW/nb3fvy+BszUgpGB5LqBvC/fW6vEBT79XU2nTGZkb9/UVR8kmib7f/7Z88tUuzIM2DjX3x3Mcj9rzrxwfMEVuwIAegIwsXZajBAIe3pocE+0Ywy/ub8h4OMNn47YGl4ZuzEFZHc5VqHIZD4fWNrL6cbLtxydhE4b24cWmV2Gp59CbaTb+OIaTlhsu1XoqDD4Id4vKW3GHKX7q3IS69WjEuwU3xXhUHpE1sURQoJEPD4ojlsyDLstiHc7Auw5jPXeLXO/ZCMwt+y3tFM38sRXicSw0roh3GXsKJKW5yU93Dx62pT+GC559MIq37uQ3A/57begignTZOL+7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CZ8LPRODNROliyWFQEqJrDx7qd23VepRNH3U8cOhUuGqBlU6fqlYQRfyXAB1xlloggZKCohUXo/FYZAZ9rFmh30YlvHyXQPCBhvze1sUZA/8TrF47w6+2olUnjBc7rtRUF9hKAx9ng/K9aJkBOrUQHfBBaElAgnCZMl+W1DNBeFJS5eh3/G546zB/QJYwDifb/i3sA1scpK9etDH8Znqewal0l36QCBUc5lrNVJe+F+b3SjNZpCOH/xKHWyxADZTnxdDct+NOeOsiIsWbCUq7/t5I6IR6wFw/wzH9yvzBF78G8PKb8g2ChhVYqdow9dd6AxTVxVGEoAWSzYhdWtpYVy2LzjaJEKRUDOFlIGVM1+T80JSPSfhQM3YEqxwRg==;5:j7g9h7i6/LaNPEsTW8GTqRuZseYjRE8tXrNvFQTBF9TPwYGK8JSG3dNjVjZ+JpyZ3FxKr6a2clbYVqkhQmmxIXxKfGaQYiD6AxpW+66dXyiCWKouqCC+osjpmsDufxJeKGIoFWMZAd7ghdAp6iMCqvfF+/W4WyVt7QlFsEy44Ws=;7:R4pROOwACc6n2a6bBm2/EJ9X6iHS/6J5xgzi8bCbYzss+Vpv7vwzOmlRyCgIRNJzW/x+TLviqzrAsDGEVLvuZ97ElpT72Y4XYIhmqlDMdMJMCeXFmjUOTVOKpZvaEEcOMrAseeU18pgnADPX0X8YtkWS/6C+6ssebTn2zXoBWT3mrJv50lZQR6+40Io6JnuEQx52SQVnOAR7ZVFA1X+PEnhP9EAyc1287hU/vd2ATT6Xi6T5QUKhUp3qbhepf39u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:32.3349 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6eb2fad5-5a7b-42ca-e044-08d62436da26 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: BYAPR07MB4661 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 This patch fixes issue where driver clears Nport ID map instead of marking handle in use. Once driver clears NPort ID from the database, it can reuse same NPort ID resulting in a PLOGI failure. Fixes: a084fd68e1d2 ("scsi: qla2xxx: Fix re-login for Nport Handle in use") Cc: Signed-of-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 18 ++++-------------- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index b934977c5c26..dbeb85f161e3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1952,25 +1952,15 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) cid.b.rsvd_1 = 0; ql_dbg(ql_dbg_disc, vha, 0x20ec, - "%s %d %8phC LoopID 0x%x in use post gnl\n", + "%s %d %8phC lid %#x in use with pid %06x post gnl\n", __func__, __LINE__, ea->fcport->port_name, - ea->fcport->loop_id); + ea->fcport->loop_id, cid.b24); - if (IS_SW_RESV_ADDR(cid)) { - set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); - ea->fcport->loop_id = FC_NO_LOOP_ID; - } else { - qla2x00_clear_loop_id(ea->fcport); - } + set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); + ea->fcport->loop_id = FC_NO_LOOP_ID; qla24xx_post_gnl_work(vha, ea->fcport); break; case MBS_PORT_ID_USED: - ql_dbg(ql_dbg_disc, vha, 0x20ed, - "%s %d %8phC NPortId %02x%02x%02x inuse post gidpn\n", - __func__, __LINE__, ea->fcport->port_name, - ea->fcport->d_id.b.domain, ea->fcport->d_id.b.area, - ea->fcport->d_id.b.al_pa); - lid = ea->iop[1] & 0xffff; qlt_find_sess_invalidate_other(vha, wwn_to_u64(ea->fcport->port_name), diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 8c811b251d42..d2888b30a8a3 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -1261,7 +1261,8 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) qla24xx_chk_fcp_state(sess); ql_dbg(ql_dbg_tgt, sess->vha, 0xe001, - "Scheduling sess %p for deletion\n", sess); + "Scheduling sess %p for deletion %8phC\n", + sess, sess->port_name); INIT_WORK(&sess->del_work, qla24xx_delete_sess_fn); WARN_ON(!queue_work(sess->vha->hw->wq, &sess->del_work)); From patchwork Thu Sep 27 05:05:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617235 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 22BC9180E for ; Thu, 27 Sep 2018 05:05:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1250F2B199 for ; Thu, 27 Sep 2018 05:05:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 066662B247; Thu, 27 Sep 2018 05:05:40 +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 5A9FF2B199 for ; Thu, 27 Sep 2018 05:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbeI0LV7 (ORCPT ); Thu, 27 Sep 2018 07:21:59 -0400 Received: from mail-dm3nam03on0046.outbound.protection.outlook.com ([104.47.41.46]:9132 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726469AbeI0LV7 (ORCPT ); Thu, 27 Sep 2018 07:21:59 -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=nPy+n8Kqkiopo4Zjt2PhJ+fTm7Z5roiECKh4YF92FNA=; b=PguMY0IRMBH14ZRmcACX1ujCUClgkNatTrjIzg+18vhSPKE/Ej/Q6VoHwyu50TWtIEDmADpuwEo4P97r0s9dKR0w/kbb5xXnwFRJvgdtMQNmmNehOad5NONT3JYxFQ8jBAKO8PH8DLB6FUq0QorfUB1EGfuJwTYjUp5/4AH0KWQ= Received: from CO2PR07CA0052.namprd07.prod.outlook.com (2603:10b6:100::20) by DM6PR07MB4393.namprd07.prod.outlook.com (2603:10b6:5:bf::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Thu, 27 Sep 2018 05:05:34 +0000 Received: from DM3NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR07CA0052.outlook.office365.com (2603:10b6:100::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1164.22 via Frontend Transport; Thu, 27 Sep 2018 05:05:34 +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:34 +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:20 -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 w8R55J71007202; Wed, 26 Sep 2018 22:05:19 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w8R55JKE007201; Wed, 26 Sep 2018 22:05:19 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 5/8] qla2xxx: Fix driver hang when FC-NVMe LUNs are configured Date: Wed, 26 Sep 2018 22:05:15 -0700 Message-ID: <20180927050518.7147-6-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)(376002)(346002)(39860400002)(396003)(136003)(2980300002)(438002)(189003)(199004)(478600001)(48376002)(2906002)(1076002)(106466001)(50466002)(36756003)(72206003)(47776003)(76176011)(87636003)(51416003)(80596001)(486006)(34290500001)(44832011)(126002)(476003)(2616005)(446003)(11346002)(336012)(4326008)(110136005)(50226002)(14444005)(81166006)(26005)(186003)(54906003)(8936002)(16586007)(8676002)(42186006)(86362001)(81156014)(316002)(356003)(5660300001)(305945005)(69596002)(6666003)(106002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR07MB4393;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:9IpA7YuGwNrlvIu1zx+UnfPv2VO9Gvy1Sl38UGWvPqOqAhOsy0xWD+QQtxxOzTxa7sv5G++5QXWBfHaZ8NdmseAt7vjuc+dT50x58hiSO5v5ijuG85tQKGGIPu+1Shuu X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02878cc4-07ff-4843-862a-08d62436db4e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM6PR07MB4393; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4393;3:K96unQyxbjbO6wq3+FrPuMlP/LyDJNTZfP3dwHvrCkpp2MHnKAZDIt+UbVlboWBj4w3/airPgIa+uSRmvLYUE5cYoIdqHmm1iexC/A7ZC0UkCyTNLJuHDSCt2R1ugJm8sYBSjFD7cnU/zH1GM2SplgzhPWbmUEbccxHm48VEbmzff4tITa1cGjCzDYcqxhNFWZAO7cVJmwAox1wiadxKdcuGc65npGjqrnoTpO+tlOqF8F+xL4iA/F6mmBmkHyLBG7G0YoPdznez3taiD6qRXjcU6U6BDuc85yPS10vb9BhMtMXEM+Y1R9ffQppL91TtzUKsThsRqGvDmr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ztPf+M38nXZtRRI/jZnJIpAJHaMg13oDy6ho3wiXq3sg2rKp4HxuqLMEW3LhvGuptr532x7Ewc0Jtwol933Fj2y0KABN6TQj9TTsigofPj/mWYQKJx2typ+FjV4cAyI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123564045)(201708071742011)(7699051);SRVR:DM6PR07MB4393;BCL:0;PCL:0;RULEID:;SRVR:DM6PR07MB4393; X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4393;4:8ndpmGprAKsJpO4I3PnKRKOYTPQ6sT3qdoAN2o3cwGUPRecO8WwzAk8ekZyn8WGag2svQAMBuTKdygtfsOiL96EK4TI6og+QdgkPG4ixC/aMKC1wOaNiv6MWo1u4V22OFydd5g16fmd6xRmlc/5tbGPBm8wL71NzhWbBmkEbWHAA6ogS/OGNI9MzdADRBpxPY8tSIDnY9Vm4pw0U8w6v4MqenRYX5+toeF5dOCXKc5bCCN/VAKFgrF47DQJBvBB81VgL4gmW+qSio2idvjL7tTnidioZfCd7p3MNiutog+rLDChIsV4uUF/6zl7to+E9 X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;DM6PR07MB4393;23:Jz62q1Exf8iL8vO2+o7SUkS68qjUN+gT4dWIC8kEXnN/hpO3kvdnjExmHGUiq45rwHg4vGZbxy2wR1E2Z8RIZYwzahLgX96fs97IkUuRC104iYjBSjZGFXo1px2CZC2k9+UPdIsG1X5eC6mwQz7MfEIo1bSLq/WCH9CzirT6jbCBiC0RYJsahiCtNuwzzD+jHMmBNUG8RZhKCcAiPN1jd6pXm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MUUaZRvFsWzGdkk5oqkDeXZV/TDixTXYFEq2dDMI3N3TOlgCNNAtj7geiqG0hhM+LsSixxmxsKp07bCaQoj509f61+tI0qc+ep40BScCNNZI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:34.2569 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02878cc4-07ff-4843-862a-08d62436db4e 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: DM6PR07MB4393 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 This patch fixes multiple call for qla_nvme_unregister_remote_port() as part of qlt_schedule_session_for_deletion(), Do not call it again during qla_nvme_delete() Fixes: e473b3074104 ("scsi: qla2xxx: Add FC-NVMe abort processing") Cc: Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_nvme.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_nvme.c b/drivers/scsi/qla2xxx/qla_nvme.c index 8dc7a5c64800..e6545cb9a2c1 100644 --- a/drivers/scsi/qla2xxx/qla_nvme.c +++ b/drivers/scsi/qla2xxx/qla_nvme.c @@ -660,9 +660,6 @@ void qla_nvme_delete(struct scsi_qla_host *vha) __func__, fcport); nvme_fc_set_remoteport_devloss(fcport->nvme_remote_port, 0); - init_completion(&fcport->nvme_del_done); - nvme_fc_unregister_remoteport(fcport->nvme_remote_port); - wait_for_completion(&fcport->nvme_del_done); } if (vha->nvme_local_port) { From patchwork Thu Sep 27 05:05:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617237 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 BD6FD3E9D for ; Thu, 27 Sep 2018 05:05:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A4CE52B199 for ; Thu, 27 Sep 2018 05:05:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 98F0C2B247; Thu, 27 Sep 2018 05:05:40 +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 2F47E2B1E7 for ; Thu, 27 Sep 2018 05:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbeI0LWA (ORCPT ); Thu, 27 Sep 2018 07:22:00 -0400 Received: from mail-eopbgr680078.outbound.protection.outlook.com ([40.107.68.78]:50720 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726669AbeI0LV7 (ORCPT ); Thu, 27 Sep 2018 07:21:59 -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=AfAvXqv2ylo1SUhD9VcF2WhD71cU56a6DXwL0uDf5Sw=; b=MTTwZrmQWXTZi3RLhuluBNSlhxTu7Bm3M7tgRsYf7MSiMBMc4wkbBe59qiu5z66YdpfRZCjBdMPdHqnvA16as+iM7gXmG9IVXGZOqcL1JZMzPru8jj4vWccFjIzAg/x8esXTG1r7eGjauyzeRIHbIX+GELTbpe3nZ6bKDhD3C5Q= Received: from CO2PR07CA0070.namprd07.prod.outlook.com (2603:10b6:100::38) by BYAPR07MB4662.namprd07.prod.outlook.com (2603:10b6:a02:f1::20) 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:36 +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:36 +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:36 +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 w8R55Kr3007206; 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 w8R55KJ2007205; Wed, 26 Sep 2018 22:05:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 6/8] qla2xxx: Fix recursive mailbox timeout Date: Wed, 26 Sep 2018 22:05:16 -0700 Message-ID: <20180927050518.7147-7-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)(376002)(136003)(39850400004)(346002)(396003)(2980300002)(438002)(189003)(199004)(106466001)(2616005)(8676002)(446003)(476003)(126002)(4326008)(44832011)(486006)(356003)(72206003)(47776003)(87636003)(6666003)(11346002)(48376002)(2906002)(305945005)(50466002)(478600001)(1076002)(110136005)(54906003)(80596001)(8936002)(15650500001)(316002)(42186006)(16586007)(81156014)(336012)(106002)(86362001)(26005)(575784001)(5660300001)(69596002)(34290500001)(186003)(81166006)(76176011)(51416003)(50226002)(36756003)(14444005);DIR:OUT;SFP:1101;SCL:1;SRVR:BYAPR07MB4662;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:u+J0ALnAN7bhUzp6wWfiAyYrO8+SKb7Uk1O2ASWzfFrfWDxEjdMZ1/Fx616oRjESzNWMQWy07RTk+dvnpl4QWoDKqiAGf7mtEc51xIZwTpIwTPnOfFE5Uiy45Ok048fa X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f77826e-f6c9-4d3e-b49a-08d62436dc9e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BYAPR07MB4662; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4662;3:Ijo6WrY6VC0bZnFrGcyIUmSlK4mU5RBZkBz/rX3i4vQjkvJUR0b966ctUJyFIvHNrAXfibYarHSiJW+7M5HeAi5pnKnm/LXCKrtG7JgZTXKAPR1p2XNn5Iq9pSXK/D5YHwaqnjdwQbSMaKSXVt35uludYy7kbqHwSg2s6Q0gUNPYE4hz0BC6/lP6qxlwruVuvoiM74B3fjw/SW5uE8U/dJlLy2wwn3K81SKXmq8JWCN8DNxbejy/ytF8Z0ajDqghpRnt22VM5A4bpZa5KuPvz5/rI05h2mW/qTFun5nV861oCcgX2K/BnVdd8atAduzR5gEjSBqjgChI8vNDCdEIJrx+75Pe8cfhuHBvzO8HHzI=;25:lPKuAOHeRtNp5DACOc6WxAc+CLqWotQnclUI3QCxJaOWomXIK7CS1okjes0XFM1Ay12JQFhCnqu1rgfifG1xDC1GUdb2HNgnMAw682sya5a8UdWyWWHPOzW9qdTxt7eHLBTHY+NQ9D/bp4hDqFxrdJEQDXLvrYLpt10codIFe7lZZH9ieZqig/YqzLcHt+q+h4EXbbhPk6+8gwJ60Z69QBGaj2asGGTFzgye1bIzcnWqnETJKQLcehcuhuTxoZRTHDl3XDTkbd+4T1RheeZCQlKyUkEpEZklblYeHUiyCWUJ0qMLWLmeBZiJQCFB8KooI/sDCWeSjF6Tsoolx5fyrw== X-MS-TrafficTypeDiagnostic: BYAPR07MB4662: X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4662;31:tOn6IoaCoCMsYRPOXrLYTmNtsxmuMvKA36/Z90kb0JxQo/3Ab61zI3t9DDCq+69gJz0GBTWvujcOT8suwZEB+N94uSEAUEaa0k7rY7lCjc9pzdvhrktM7NFD5CQPd/j7FzX7origxCKBn4DE+lBIS91nqORxeYtCnTy+GQrLAHqRN0SvsvPNdTgbtbdlbnykwAKLTLA1ptrnYzLPUA3DL5VnpMI3m6enJW347yPdwR0=;20:xJ6GH+/oJrR1yul15HfVL+SNupj2SvJ8DpzZvgl5poXJ5i8+pycecpYMI4GS8GuWxPFg16B9Ho9x33uCKgX6zhcRTA3SB81cH+G55ioG/X7ZG1OQVHSyya69v9q+Ka1ZWeTofBFErHvkEcDzjBRSSpDdhUP1GR/+GbDUVz6HTBjpBnX8QdKkNSCAHiIsVxjAJyRboh4mA/Vb5GX5rREzD3lkKKe8Cpjov8LgewsyUfNELRXdL0z5Mf//3L/ShGrIvDPh4BS/xH5ms+lC4IzI1GJ6pgtctf/jgjjO+D4fM3d9PGKzuNZvcM+K0Kj5sKdB+dkYGmQ26kiCgseY6V7mO6InFgGQ5oEkToVpE3oPIfWhWeddBcUuk1Q2fJu45wUag7tu/Mg/OQbL/gnPKZngnCyBWiv5nEa3YV8ZRPbB/RVNxtVqI0SrW8v1fr9hdx8iXxa/fyBB5H6GMnSVkIjq+doBZ7shbHedjiYs9vz596TxOrkx/f9Phh5R6/2q3jGo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(10201501046)(93006095)(93004095)(3002001)(149066)(150057)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051);SRVR:BYAPR07MB4662;BCL:0;PCL:0;RULEID:;SRVR:BYAPR07MB4662; X-Microsoft-Exchange-Diagnostics: 1;BYAPR07MB4662;4:7GwaqSJ7/gWsYEm+1vY13fP4r5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Ab6NII6JCDOZWYpXb6ovJ+Bgv+On+Yp7F9S45kMZiUGXdDHMu4RdxyNYfSJCDtoGnPjXVCk2mmxYhCZCjuJK7ow+EWaGa/cE/jZpynT3IhsEeqCKMBHn7OwPPWJ4v1ZchrWSIOxq33QGBPFsiQ7G9IQerV0YL6+wqkVN/CCorhAUXHQPqdn7vGF82QwHWAmLoOwEFYHXM7DwuJu80S42SwOzQztiaE2NK4+PU3/zP1T9wec0atNs6eoYEIjPc0dOheLTdHU4w4sURniLI/xA==;5:87GDuPhv7mhXlo6AzJGM/hLLz034jw7IbulVtIcP+LLvlkerKQFtY/tJ9uPn5jSCrqf5EiX2UwabN/DDywsWrgsMDTo82IrY6ZDZ8S0/8x+MASUIuI1AzC2+dkWj3/o7NieSuW8E2cIzRr/rA2Ba0cjawA9NDR6t2CzMYN/6wp8=;7:4/1OhG97iwLcs1mJMMnwBrG5j5YpmcdbbEHPJz0z9lvawzRJSpRZbNkl6W5Ux2n4Iw3QbOLc5OuXxtMir/EBSBApE6fIxTN1WgecuyOPnQMd6BRuVO1oE+2XmeJrMIZ71JULGHDO/YRl5fE2t8PuirZVnyhTWtCbDtH9knQD37isujBY+fcihenu6ZT2Ub5NZh18Z4TvA4gxSx4v/byN9oUoSLwKEY7MkvsKNj7QyAg2dpv+SZob3pyRAo01rMVx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:36.4757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f77826e-f6c9-4d3e-b49a-08d62436dc9e 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: BYAPR07MB4662 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 This patch prevents user space mailbox request from doing chip reset if the mailbox timed out. The chip reset is only reserved for the DPC thread to ensure all mailbox requests are flushed properly. The DPC thread is responsible for the flushing all MBs and chip reset. Fixes: b2000805a975 ("scsi: qla2xxx: Flush mailbox commands on chip reset") Cc: Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_mbx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 2c6c2cd5a0d0..596a9b214df1 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -493,7 +493,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp) set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); qla2xxx_wake_dpc(vha); } - } else if (!abort_active) { + } else if (current == ha->dpc_thread) { /* call abort directly since we are in the DPC thread */ ql_dbg(ql_dbg_mbx, vha, 0x101d, "Timeout, calling abort_isp.\n"); From patchwork Thu Sep 27 05:05:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10617241 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 54AA2180E for ; Thu, 27 Sep 2018 05:07:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4365D2B199 for ; Thu, 27 Sep 2018 05:07:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37BF92B247; Thu, 27 Sep 2018 05:07:03 +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 A78F92B199 for ; Thu, 27 Sep 2018 05:07:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726639AbeI0LXX (ORCPT ); Thu, 27 Sep 2018 07:23:23 -0400 Received: from mail-by2nam03on0047.outbound.protection.outlook.com ([104.47.42.47]:24474 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726590AbeI0LXW (ORCPT ); Thu, 27 Sep 2018 07:23:22 -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=LHUxP11l0yNI7qG+f8Z7UOTuWIG5n7Ca/AIv2XS0EOk=; b=krIvNlsNLFaWVYLX1zS3ZHsVaSGxyy84YPlOaP/MlUWN6hewztiVuLisPBeLclYgv2zVdmEN/9bRbo2+6fTDsVuH8qFV1QSYblTzhyteiHKXTWritSIMAnnGDwycKNGYUn4snN7/H8LlBw+csU9hdK10l77V/c7K2rATvPcqeXg= Received: from CO2PR07CA0070.namprd07.prod.outlook.com (2603:10b6:100::38) by SN6PR07MB4397.namprd07.prod.outlook.com (2603:10b6:805:58::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.17; Thu, 27 Sep 2018 05:05:41 +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:41 +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:41 +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 w8R55K19007210; 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 w8R55KRM007209; Wed, 26 Sep 2018 22:05:20 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 7/8] qla2xxx: Fix for double free of SRB structure used in Async switch query commands Date: Wed, 26 Sep 2018 22:05:17 -0700 Message-ID: <20180927050518.7147-8-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)(376002)(39850400004)(346002)(136003)(2980300002)(438002)(189003)(199004)(446003)(2616005)(6666003)(50466002)(8676002)(48376002)(11346002)(1076002)(26005)(356003)(4326008)(5660300001)(44832011)(2906002)(186003)(50226002)(72206003)(86362001)(126002)(476003)(486006)(69596002)(8936002)(110136005)(316002)(42186006)(106002)(54906003)(16586007)(76176011)(51416003)(80596001)(47776003)(81166006)(336012)(81156014)(14444005)(305945005)(34290500001)(87636003)(478600001)(36756003)(106466001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN6PR07MB4397;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:PVSS277e9OuOvt3B7ZSaGT5TlgL/TNDyRkJNDhnCHLxcWzga1SbW0U4vtwQevEYTnRrQj/92964cnjLsmwmvuVHMDBmRI5rPfFLHPzF4J39ZV2umur6X+A8b5bgC+ypt X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8aa93922-c588-4be3-d278-08d62436dfa0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;3:+TZ5vWb5iT01OvezasfEqzale1JujhlGD962oZI6q3H4xwQ4qM5nVKDhNMUvMdAi3sl+EY+g6ntnn6Nq1kQqARKi8ucEuyN5O7UDtYwKnPLuaywvORWGBEc6BBNajoFQ9hmGUVo0etdOrl6WlBgqwF4WyvNB1rKgZ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visdYTVhTUFv0jLgBFYXqq5RdVCRCImp8pjyKYnNyptsCLaBYQrISYIOxBaTxKSPLtjPp2q/HstN0my+Sx014/Y8w0ZZeOTsrakmaTCeOOoauw8OJi+ZWkqyg5OPjwoW04ljkH2XIFyj0pAXJWIPcSgFYIRpPzyTQ7Z6U5S6UWzYErVUubX0B/MynsXV4QHTw5Jaal24h1mkFIhvHnF8VoJ05xC55lPXT8P0CSMt6xrx3fNqRMptOcqZFwscRAQ4MHaBjcj/z1GjKG6Yn1PlBBrLF7/j99WeKk2bb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(201708071742011)(7699051);SRVR:SN6PR07MB4397;BCL:0;PCL:0;RULEID:;SRVR:SN6PR07MB4397; X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;4:KEp2AaCYTD8mwAnsft1tYfVC+lEUqrup+4CdUcB4IjEoVeI7dWEWZhMs0V3EX/iveGuyTskNQuuTTWtJaFWuFZWFPfli/3Toct3EJpVUNL3ivvX7ENEt0zjPJG7L/gSyvMWmDu7c21/LVkiZ43Ptoiv4vdOUPBHhaRT71GhwcMxAIWvXQZFyTAvf4wb1G27p9H9W7c5SNW67edpiOG6++qGPIz3J1U/q3ysubvyeSU8IaC8SsDBcqkvXs6KyGQQBVVOc2w5TFZEkztCt1ll1ky2Rvb4rNHtp/bZyt+LxvoE8HT9SK42AWoFbZQ7qLrtY X-Forefront-PRVS: 0808323E97 X-Microsoft-Exchange-Diagnostics: 1;SN6PR07MB4397;23:J+rL2q/niUKR2619FWpcKS3Ak9e9ulxJdLFS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ioQrpA971WU19umcL0/glOM0i5lMbryqTt3S7eVcu83Gt4=;7:aUiMDi59HjE89gUN02a19e0lZoQfNgnZnD1sYlLu+4uzfR3h/KSrJZGu2TYiHvZ93QxGExFJYsvM28riSdbCAA5hAFhzf54n/31OtwHdraHoatN0rhnXQDMMEA+BghKW25w8B0KynnyhDFMOXOft2plGZLin1+RZA+B4+6zJXNn0qw8l0NGpVFE6kc4ZxxB/dhp6BwVID7MixbLOByJbwYB4GRGZlQZdpK6lh5F331jptSsl/PlK0ofTlnz7ap8r SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2018 05:05:41.5071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8aa93922-c588-4be3-d278-08d62436dfa0 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: SN6PR07MB4397 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 This patch fixes issue during switch command query where driver was freeing SRB resources multiple times Following stack trace will be seen [ 853.436234] BUG: unable to handle kernel NULL pointer dereference at 0000000000000001 [ 853.436348] IP: [] kmem_cache_alloc+0x74/0x1e0 [ 853.436476] PGD 0 [ 853.436601] Oops: 0000 [#1] SMP [ 853.454700] [] ? mod_timer+0x14a/0x220 [ 853.455543] [] mempool_alloc_slab+0x15/0x20 [ 853.456395] [] mempool_alloc+0x69/0x170 [ 853.457257] [] ? internal_add_timer+0x32/0x70 [ 853.458136] [] qla2xxx_queuecommand+0x29b/0x3f0 [qla2xxx] [ 853.459024] [] scsi_dispatch_cmd+0xaa/0x230 [ 853.459923] [] scsi_request_fn+0x4df/0x680 [ 853.460829] [] ? __switch_to+0xd7/0x510 [ 853.461747] [] __blk_run_queue+0x33/0x40 [ 853.462670] [] blk_delay_work+0x25/0x40 [ 853.463603] [] process_one_work+0x17a/0x440 [ 853.464546] [] worker_thread+0x126/0x3c0 [ 853.465501] [] ? manage_workers.isra.24+0x2a0/0x2a0 [ 853.466447] [] kthread+0xcf/0xe0 [ 853.467379] [] ? insert_kthread_work+0x40/0x40 [ 853.470172] Code: db e2 7e 49 8b 50 08 4d 8b 20 49 8b 40 10 4d 85 e4 0f 84 20 01 00 00 48 85 c0 0f 84 17 01 00 00 49 63 46 20 48 8d 4a 01 4d 8b 06 <49> 8b 1c 04 4c 89 e0 65 49 0f c7 08 0f 94 c0 84 c0 74 ba 49 63 [ 853.472072] RIP [] kmem_cache_alloc+0x74/0x1e0 [ 853.472971] RSP 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 | 3 +++ drivers/scsi/qla2xxx/qla_init.c | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index e22c038e47a8..de3f2a097451 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c @@ -3261,6 +3261,9 @@ 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); + if (res == QLA_FUNCTION_TIMEOUT) + return; + if (res == (DID_ERROR << 16)) { /* entry status error */ goto done; diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index dbeb85f161e3..afb6cd7b6800 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -52,12 +52,14 @@ qla2x00_sp_timeout(struct timer_list *t) struct srb_iocb *iocb; struct req_que *req; unsigned long flags; + struct qla_hw_data *ha = sp->vha->hw; - spin_lock_irqsave(sp->qpair->qp_lock_ptr, flags); + WARN_ON(irqs_disabled()); + spin_lock_irqsave(&ha->hardware_lock, flags); req = sp->qpair->req; req->outstanding_cmds[sp->handle] = NULL; iocb = &sp->u.iocb_cmd; - spin_unlock_irqrestore(sp->qpair->qp_lock_ptr, flags); + spin_unlock_irqrestore(&ha->hardware_lock, flags); iocb->timeout(sp); } @@ -787,6 +789,9 @@ qla24xx_async_gnl_sp_done(void *s, int res) sp->name, res, sp->u.iocb_cmd.u.mbx.in_mb[1], sp->u.iocb_cmd.u.mbx.in_mb[2]); + if (res == QLA_FUNCTION_TIMEOUT) + return; + memset(&ea, 0, sizeof(ea)); ea.sp = sp; ea.rc = res; @@ -972,6 +977,12 @@ void qla24xx_async_gpdb_sp_done(void *s, int res) fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); + if (res == QLA_FUNCTION_TIMEOUT) { + dma_pool_free(sp->vha->hw->s_dma_pool, sp->u.iocb_cmd.u.mbx.in, + sp->u.iocb_cmd.u.mbx.in_dma); + return; + } + memset(&ea, 0, sizeof(ea)); ea.event = FCME_GPDB_DONE; ea.fcport = fcport; 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/LCR3gISNiYTSTP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6mdykJsEtCLb3lwlc2TipVeW/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/BnGn3Tv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L0f9cH5iX/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 ?