From patchwork Wed Jul 25 17:01: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: 10544455 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 8AB1D14E2 for ; Wed, 25 Jul 2018 17:01:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 770FE2A1A8 for ; Wed, 25 Jul 2018 17:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BEDD2A841; Wed, 25 Jul 2018 17:01:39 +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 D0E642A1A8 for ; Wed, 25 Jul 2018 17:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729509AbeGYSOK (ORCPT ); Wed, 25 Jul 2018 14:14:10 -0400 Received: from mail-eopbgr690045.outbound.protection.outlook.com ([40.107.69.45]:18400 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729450AbeGYSOI (ORCPT ); Wed, 25 Jul 2018 14:14:08 -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=XZFoBFzrSmeoL5AALXHvVzlCji/Ni521s8wVLRJc0VE=; b=G9h+WTbdOIVxQyLp5KAnrKvX3uXyOFGuS7yw89hCA4C8WfnK0OGNwxDrzg2JiPSguCVp07+/bhwSUzdsYAP+AoiC3+NYQv6OZjr1gj7Sp6U1SXXgflqBudfcGrcEXCkeeuAktVwJGK9VHT/N/LmMlHZrqT45USmhiPa0pNgj9pk= Received: from DM5PR07CA0029.namprd07.prod.outlook.com (2603:10b6:3:16::15) by SN1PR07MB1472.namprd07.prod.outlook.com (2a01:111:e400:5838::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Wed, 25 Jul 2018 17:01:34 +0000 Received: from DM3NAM05FT022.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::201) by DM5PR07CA0029.outlook.office365.com (2603:10b6:3:16::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.995.16 via Frontend Transport; Wed, 25 Jul 2018 17:01:33 +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 DM3NAM05FT022.mail.protection.outlook.com (10.152.98.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.1017.0 via Frontend Transport; Wed, 25 Jul 2018 17:01:33 +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, 25 Jul 2018 10:01:22 -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 w6PH1MEI010340; Wed, 25 Jul 2018 10:01:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w6PH1M7E010339; Wed, 25 Jul 2018 10:01:22 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH 09/16] qla2xxx: Fix unintended Logout Date: Wed, 25 Jul 2018 10:01:13 -0700 Message-ID: <20180725170120.10269-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180725170120.10269-1-himanshu.madhani@cavium.com> References: <20180725170120.10269-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)(136003)(376002)(39860400002)(346002)(2980300002)(438002)(189003)(199004)(54906003)(356003)(336012)(476003)(8676002)(76176011)(186003)(11346002)(126002)(2616005)(1076002)(446003)(5660300001)(106466001)(8936002)(26005)(81156014)(486006)(51416003)(81166006)(44832011)(106002)(6666003)(50226002)(47776003)(2906002)(87636003)(14444005)(48376002)(478600001)(50466002)(80596001)(4326008)(110136005)(42186006)(86362001)(316002)(36756003)(16586007)(69596002)(72206003)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB1472;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;DM3NAM05FT022;1:VQy76nWKjXOX5oWKTS8cTBeX8akL9KFosBx8SuJccAeHumhu8OLDsXxralwzm4OAApKQnfCctImw9lchMSu4aThGlzmfHoOuaJ3YKZ88eLEizfpV9qNW6kj8QLGsx2ER X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ff7cddb-5e96-4bdc-7827-08d5f250467f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600073)(711020)(4608076)(2017052603328)(7153060);SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;3:M0x0wHo5eg1EvPT0lV1WjMNpHbgAqoDOP0BpLu2ecb+bxcYtr3xtlaktKLIIiePDdxvfZqXMGEjcg4mwO8nKYx0XoOA7xhcNIXuhyPOyUAauXPNGLoZsHo07gojz8zP+s0GfW8EVByk9Q70UOB3jnQ4M69gJuV274BZ/kCkTDlr+M+U0KhhS+eM/V6+I9yhODiscM22YvSImNry87GyodREEXRGA5BAEjn0e4MV1gqjA8KkOlkVLMeqyiKpt/9VVxrdQYyWDg9M3zmJhTwMPG9oeG2vL4s5EkLmqs/Uq6VoUxBQ88iYiKuv06+AroDKCZsWLD2JOcalnC/dcLjvLz5tWN7FSKJxYX6LnRcOx1Os=;25:nGR1E0EZp4ZSIZy0qTn84g9EAZWHICS8XHH7rYSs6cNPVwf961H699Ci2RFRu1jkcBTuceQwAslqRc7qOKuKjEMQiE/Yf7EAmMs6WflUNIZcMx+eIIBe+XZc4kkdpKN72cvUZUaA0GrxlFa1es0b/Xl4Xb/vl+U8KzLJzu/f0ykdccJn3xU7d2Y7H3gU/X9xNSN3mPhSr/jnwOBGvI7WQz7/4MLW6w7UUxYN5x4XxyufMqPi80xN2hAmbcQBD+YJls0JQnKxZraygps5yv9FbN8wiDQbSjsi1ul3JbrIOG+tSxB+bOJEhvAotTxM/lgg6j6ONo5M2vCUFmKg4JfvYg== X-MS-TrafficTypeDiagnostic: SN1PR07MB1472: X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;31:lR8bIJV43rFO46d1khXx7byWGB8AcC2FZIlWNol2lLulfR86VNCGR1ViBcWFm51fL9kSkXhpU9TZokgt2O2iu9OkvUR/wO6C/lgIJbEgZ/9yc3bRCOiTQ+1SIYwd1HSzlQgDVR48Wqws1dia21/UfuMs3lrrEHW6VkITA0c9enc9gaUJftMIFGQOjZ1sZAWXVrkLFL7WsevJhGVYtO8HdqxZ6wCqsNaGJV/+zrwya9Q=;20:IDdZLqkRP8M7DOVI/mpWHT/Js7wrRjazGGOVk9Nng0ip/nYZJrd1xs4m/eNFapU9s25cv7Qkm4V1GteTNW/994tZKJzulp0yYgZjphkP8VVWNVAfGYGHhoVkKj8XFR4jx6Hss4x5pLxNx5BnPkPsBvvWv5kN6OVmczL6eASEy74BmqfTlpMh0tn+RNrQbq6SUH4iL3S0TAeV9rkdEeHTxGi1Cg/p9igGeTN26o0codsGG3+HhIlOraddg1GYqMg5I/nq+EyBjegDQ9JZ3+wCnA2KvTylZLx1ZS0d+k9npFeEMagHvtfYqjzf81QslBtXKcMrMJLnlXUXF8XiJGgN17ptUW9wG0hto4tGJx19T1V/FiDYi7xIlaXPogSf1Klu/Cam9Akqf02rXG0OJzTyPMo0ogUeeeQU/yvHFrBcLlFJ7sKfUXjAx15d+7dvGGodJOl4PsY17Muqa2/G8gXT62BzT1b2aQCh677F4ghtDz7VyQ83rxahqaeBba1DPeZQ 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)(5005006)(8121501046)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR07MB1472;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB1472; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB1472;4:zwrmfDIPewOHUk7GjAGeNrEWkiz+Ytdm0lS8QCMmw7cagReCVm0t9cvZgT7uqJV/sal1k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K/1nqJ3VhIRe1LRI8ntSRM7R77PPWAbAu0aWzdyv5BhRvlRyY+ftC9tdvAsPW9R/BN62Iu+WfwvlgwHrByiKa1Tu/uiPk3ArmUAYsAv0/Am7zPMmqrXHg8jF3HQ7n5VtivZPFdSMs2GiPes3cTbdzyexyucwWg==;5:rcpOvuQibR6+35uIoM4AozuLDrmVq0mE6gW0z/hTtlkvqtcOtiwDzVMK/X8RVoQLt+UfznRYuqqyWK1ZTxHyTEiX9gn4VdQDXynOMqu5WnnYjao5oIoEIm8+7BXDi6eobzINleu/KxwczyszUKIWaoIyfXdnw7QtMuLjJ75AxWU=;7:xTqXix8qhHthFkW8WoEdf4nUWE8O/bp4Z7PohsU1DM8rOiYlNwcR4NK3FkG9zQIOEupNcvkjTN+qezx0J1fr5VYLveNck5LfnkqekDuRnjC2Hps3ETaHFHVFcD1RHqb7L2dEwQdIINjeYV2rlml/NekXMd7XtwaHLYkCiSKdNyO23Vkqohq9VurrPv5s/AMgzVBwWOMEc+OgX0i4NuikdoxY153bgYxltUhbkPAhEe50ZvIi4Nb/iY09dLJ4mp8u SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2018 17:01:33.3888 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ff7cddb-5e96-4bdc-7827-08d5f250467f 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: SN1PR07MB1472 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 During normal IO, FW can return IO with 'port unavailble' status. Driver would send a LOGO to remote port for session resync. On an off chance, a PLOGI could arrive before sending the LOGO. This patch will skip sendiing LOGO, if a PLOGI just came in. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 70c98316b793..8c811b251d42 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -986,8 +986,9 @@ void qlt_free_session_done(struct work_struct *work) logo.id = sess->d_id; logo.cmd_count = 0; + if (!own) + qlt_send_first_logo(vha, &logo); sess->send_els_logo = 0; - qlt_send_first_logo(vha, &logo); } if (sess->logout_on_delete && sess->loop_id != FC_NO_LOOP_ID) {