From patchwork Fri Feb 15 22:37:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10816059 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 5ACCD1575 for ; Fri, 15 Feb 2019 22:38:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B430300C7 for ; Fri, 15 Feb 2019 22:38:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3EB74300EE; Fri, 15 Feb 2019 22:38:48 +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,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 DA1F4300C7 for ; Fri, 15 Feb 2019 22:38:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392190AbfBOWir (ORCPT ); Fri, 15 Feb 2019 17:38:47 -0500 Received: from mail-eopbgr690089.outbound.protection.outlook.com ([40.107.69.89]:1392 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2391999AbfBOWir (ORCPT ); Fri, 15 Feb 2019 17:38:47 -0500 Received: from BYAPR07CA0026.namprd07.prod.outlook.com (2603:10b6:a02:bc::39) by BLUPR0701MB1923.namprd07.prod.outlook.com (2a01:111:e400:5164::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1622.16; Fri, 15 Feb 2019 22:38:44 +0000 Received: from BY2NAM05FT029.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by BYAPR07CA0026.outlook.office365.com (2603:10b6:a02:bc::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1622.16 via Frontend Transport; Fri, 15 Feb 2019 22:38:44 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT029.mail.protection.outlook.com (10.152.100.166) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Fri, 15 Feb 2019 22:38:43 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Fri, 15 Feb 2019 14:37:40 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x1FMbd3x025494; Fri, 15 Feb 2019 14:37:39 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1FMbdEu025493; Fri, 15 Feb 2019 14:37:39 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 05/11] qla2xxx: Prevent multiple ADISC commands per session Date: Fri, 15 Feb 2019 14:37:16 -0800 Message-ID: <20190215223722.25439-6-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190215223722.25439-1-hmadhani@marvell.com> References: <20190215223722.25439-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131947439241589348;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(50466002)(498600001)(26826003)(476003)(87636003)(69596002)(4326008)(126002)(86362001)(2616005)(53936002)(36906005)(80596001)(1076003)(106466001)(305945005)(446003)(105606002)(4744005)(11346002)(36756003)(26005)(51416003)(42186006)(2906002)(76176011)(486006)(316002)(68736007)(16586007)(110136005)(54906003)(85426001)(81166006)(81156014)(8676002)(6666004)(356004)(97736004)(8936002)(336012)(48376002)(50226002)(47776003)(5660300002);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1923;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f2bfebf-3fbc-4aa5-ebae-08d693965779 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BLUPR0701MB1923; X-MS-TrafficTypeDiagnostic: BLUPR0701MB1923: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09497C15EB X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1923;23:TVoYH8RBYXmRtsJMtZ0ZtqdTVtu5kScBP8K1rnDAyCH0cywgCw0LG/GJinjlTRPDVW9juoYHK/r0W8PCfiqkqPSVNNyq+R0ttb3AYcs/vU96LjwtlSGojg21EEK74WrfDvIU/Um+0WVpnCxwbBwKgFu2ecp693B08btj0tDjpPGHNcoJXbXFztT6fXQNcb2iSnqxQDog6tcUxf+q4mg4P73rkByOj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R7+Qvb2688h/rphLnBcWmNhLRaM02FVot71I40xonNM/RK0TTNjjAqyxup0GLpiSWx9IJA9oUaq99vlL7hXNtKbfHzXbagjIrQw0Pz1DEe5ESsQrjE7/5cQkHuMN5YyDoDGjWw/5STZozeef2iFsNhdJ6PBFb9PatTDAoHLfUm9TVpILaccUDCt4f9ddj7l4Nc/nV84UB/HuoKIpyH4jpVRv/Fvb2WptYJ6phaUrkT+o3L9GHsGvW5NNAaaATYNlQ8WQlHJ4dz1/Y5MhfTprwRKaWckbCg+VIGu01zkp5R1+ipgtnBfoP3LWdtevqZGNSkPJHhw6NmSumCtgQeuXrFqKL7e1r3ji6zVeyA+/mSt+yBqgkr0gKVSNqSUnREQxX2iXaPFaHJ12wmJBZ+g= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2019 22:38:43.8887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f2bfebf-3fbc-4aa5-ebae-08d693965779 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1923 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 add check to allow 1 discovery command per session to be sent. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2d9336a87e42..ba5da365ee4a 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -471,9 +471,11 @@ qla2x00_async_adisc(struct scsi_qla_host *vha, fc_port_t *fcport, { srb_t *sp; struct srb_iocb *lio; - int rval; + int rval = QLA_FUNCTION_FAILED; + + if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) + return rval; - rval = QLA_FUNCTION_FAILED; fcport->flags |= FCF_ASYNC_SENT; sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); if (!sp)