From patchwork Tue Feb 12 23:40:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10808961 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 8CE7513A4 for ; Tue, 12 Feb 2019 23:42:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7BA1C2C080 for ; Tue, 12 Feb 2019 23:42:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EDDB2C083; Tue, 12 Feb 2019 23:42:23 +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 5F41E2C080 for ; Tue, 12 Feb 2019 23:42:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729496AbfBLXmV (ORCPT ); Tue, 12 Feb 2019 18:42:21 -0500 Received: from mail-eopbgr820055.outbound.protection.outlook.com ([40.107.82.55]:30866 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732236AbfBLXmU (ORCPT ); Tue, 12 Feb 2019 18:42:20 -0500 Received: from DM6PR07CA0028.namprd07.prod.outlook.com (2603:10b6:5:94::41) by BL0PR07MB5457.namprd07.prod.outlook.com (2603:10b6:208:37::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.19; Tue, 12 Feb 2019 23:42:12 +0000 Received: from CO1NAM05FT009.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::208) by DM6PR07CA0028.outlook.office365.com (2603:10b6:5:94::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1601.19 via Frontend Transport; Tue, 12 Feb 2019 23:42:12 +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 CO1NAM05FT009.mail.protection.outlook.com (10.152.96.116) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.2 via Frontend Transport; Tue, 12 Feb 2019 23:42:11 +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; Tue, 12 Feb 2019 15:41:03 -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 x1CNf3be029874; Tue, 12 Feb 2019 15:41:03 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1CNf2Xa029872; Tue, 12 Feb 2019 15:41:02 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH 05/12] qla2xxx: Prevent multiple ADISC commands per session Date: Tue, 12 Feb 2019 15:40:39 -0800 Message-ID: <20190212234046.29809-6-hmadhani@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190212234046.29809-1-hmadhani@marvell.com> References: <20190212234046.29809-1-hmadhani@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131944885319832754;(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)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(36756003)(50466002)(86362001)(50226002)(51416003)(26005)(85426001)(53936002)(76176011)(305945005)(36906005)(316002)(54906003)(8936002)(110136005)(16586007)(42186006)(47776003)(8676002)(11346002)(4326008)(80596001)(498600001)(486006)(81156014)(81166006)(2906002)(87636003)(68736007)(4744005)(446003)(1076003)(26826003)(476003)(126002)(2616005)(6666004)(48376002)(356004)(106466001)(97736004)(69596002)(105606002)(336012);DIR:OUT;SFP:1101;SCL:1;SRVR:BL0PR07MB5457;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM05FT009;1:npKLXVikcUzgo3xUpDvXngZ0d+MhCak4Bp7d7FpyUhbEvg8orNH5vcg94FTsxFpkNh7EyhgzXLJzsoRE3jWuKAFMYG5Q0Gv83DAE3k+cJtZKQcHbGhc/bDe8VKC+q6S6OGj3agZ4XS7IW6H3SsJ5UePE8L3UNr7IHGQhJwoGk/Q= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 93bf7580-35e9-4b7f-c67c-08d69143b5e1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BL0PR07MB5457; X-MS-TrafficTypeDiagnostic: BL0PR07MB5457: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 0946DC87A1 X-Microsoft-Exchange-Diagnostics: 1;BL0PR07MB5457;23:z8Q3lLciQ3g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PAS3pqSiY3gVC1S0aKzyoBmATZEjhJCV6fokPcbeiMoXNyTBSap7P9+mE4trX9g+kPPIQdxrY+RsjyVuaeIYfWv84BwpwYlslYLaanRD04Dtva/z0/HGRiY4te/aiH5vQ03XsIqTo0dOLGkH3RfxSKF2g== X-Microsoft-Antispam-Message-Info: 5xLnCIHs2uBFrD6GPOfgTsp1b9G7NnX6XIhNRoTTsUNwpcg+OmXfeLRhMtlV1HPFxMdFase4rE7vjDyxFP5TL8lnjL9OlnTY4akI8hIfJhrr16AfOsuxoLz1JDVA7qLauP/XmQZOtGpHIuMQ4jut56mcAuz2MDEEh2psNbU5e0dNN18gHnAvcu5e8Atnk5/Wz3ArxClXAVPFxB3+3rynHTbpY11DnEUsl/ovS6gQWbAwcpEf2LeLws0ePdV0qf7Xrgk31smpk6Y0R9t1ldK3tZDMDgH17xSN6FPjgl0fUg/uHUrcJOe4RnTbI7Qyz3MMlP6F23eSKp6ZiAKKGaxG5NG6By+ofwRdTzN/xwHOd7xfGir+aIgiyJJL7aoPkbS6eMSSZHPGxTca/B8yKRzpv61g2teVUKYet2+LXEoi+sY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2019 23:42:11.6880 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93bf7580-35e9-4b7f-c67c-08d69143b5e1 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: BL0PR07MB5457 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)