From patchwork Thu Aug 2 20:16:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554163 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 9EDC69093 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8B2C82C451 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F78E2C459; Thu, 2 Aug 2018 20:17:14 +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 02C262C444 for ; Thu, 2 Aug 2018 20:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729409AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:10240 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729034AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -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=q73mBtb4qToxfLr5ySc/J7IffPzGE/ckaZ8yytORsao=; b=mxsTFHC6R7jSDkGk3tojswoG9CeLCc1yINUxuOU7U762bCFb9EkfsJrQJAloHyKaWKWVX9erAC+CX9K9PR4CBC22OrYAsFzQZLfIbpElBDzRj/v15wiUH5giXIpElqFH3Z8k3ql6xlkVYKR/LROUZxmzfeUYnKM6RX8+r8N+RIA= Received: from DM5PR07CA0089.namprd07.prod.outlook.com (2603:10b6:4:ae::18) by BN3PR0701MB1378.namprd07.prod.outlook.com (2a01:111:e400:4018::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Thu, 2 Aug 2018 20:17:11 +0000 Received: from BY2NAM05FT006.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::206) by DM5PR07CA0089.outlook.office365.com (2603:10b6:4:ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend Transport; Thu, 2 Aug 2018 20:17:10 +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 BY2NAM05FT006.mail.protection.outlook.com (10.152.100.143) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.1038.3 via Frontend Transport; Thu, 2 Aug 2018 20:17:10 +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; Thu, 2 Aug 2018 13:17:01 -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 w72KH0rd007974; Thu, 2 Aug 2018 13:17:00 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w72KH0G4007973; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 09/16] qla2xxx: Fix unintended Logout Date: Thu, 2 Aug 2018 13:16:51 -0700 Message-ID: <20180802201658.7903-10-himanshu.madhani@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180802201658.7903-1-himanshu.madhani@cavium.com> References: <20180802201658.7903-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)(39860400002)(346002)(396003)(136003)(2980300002)(438002)(199004)(189003)(356003)(81156014)(81166006)(8676002)(6666003)(47776003)(2906002)(4326008)(5660300001)(478600001)(87636003)(1076002)(106466001)(186003)(72206003)(86362001)(316002)(44832011)(126002)(476003)(446003)(486006)(2616005)(50226002)(69596002)(80596001)(11346002)(305945005)(8936002)(106002)(14444005)(51416003)(110136005)(50466002)(36756003)(48376002)(336012)(42186006)(26005)(54906003)(16586007)(76176011);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR0701MB1378;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;BY2NAM05FT006;1:wouYq1oqbuk4GEBFeFbhEfy9kkIGOur0yGbRus+H6Y3GmCatOcWPwwXR3k8dSaYuiKJ0dfAsQx2zzeftx1gl6Np96gjciiIbflQQqvdln5+aB7whhr4vCKyZF7diH8vS X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4441658a-c503-4ba7-1243-08d5f8b4edaa X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;3:y5XYY26O5I5H/r03cCuAYsntN1f7QNfQQN6E7DIqYtGbZI5LlUFNcnmseipkhU3wXCWWmvcyImM6sa7JDe3gC3EE3kvjjoPOT6fvwJu4FKwKkJjzx1OpbO8RgAegOMvuDKXjKomV7qUYobveiZVDas+M2OKjwxCAXq+QXU52c9/1IU23FoATuLMdcMf6CkhKZHsK9eLUGhglJ2U90d4bETLvIgT5ciLULCD980PkxwCrM8zfTvVGFOgunaVeOFulw1dkgOR5J/mCWJfuqilqdFx4yxlprDKNJ0JjpOBpvgE2dzMb5g5lORET2gKfQjQzyLW1oZNsb0wlOeaSgDoKHwWiXq1E6aC5NL2pI7Zmu9Q=;25:TkqgdcgcfJReb7imnez6Uinyg58nlz+hdXDYPMvwzRGOF4JsnamnyqxKt79zIs0Z4hh2A7J25IQYWOv0wonrycqG24F7jordIENM5e9UwkNrXjB4jG+rN2k1dJryzmNpq5X9D7I8wg0sUobcVWw587JcguaGdyqxdhdhUCMhTKc1xXlfSwQbQcNEIlWe/pdg8sPQzY252YxUKxYtb2C046vi3E2kuvB4Dhsp54FeqlJHgAHLLGtlI8DDRB8EPrRTDcgTI7vTjLbltlcMfZ92yJIM+oUlk0AeHVRMxn9FZJ2eFbW2AIDAHfVwt2hBPrhPpvnZDruVD2AHNYWaW3iFZQ== X-MS-TrafficTypeDiagnostic: BN3PR0701MB1378: X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;31:TomexGifegeUqpGDLuVhtgmrzRBV9uDcnOQBR+14zqgxW/nYz9niBat4Ed8RELJ/PilNITtvfTtTwIARdCFYYiBLitkVqJgWTkQXE4iNbhrKe5FI+u18FA7K8iUnJxRyjvKAvGWLu0//8vOI0MZeABs1lnw0+fuwle5lLs4UL7w0WnCclrXgrAcKc+rSWW6ppBa0jZebOVxrhVTQ27pS/MD+ODuDD104ppC4rh2M8EE=;20:mW9mplycaGdte3ug1DhUtcsUFZ4gkKDlExwLkHQAV1RABHFytw+B4twmPuxUjGvXdAhAgniod2UQNZ84vQZJ99Yt3akRbJTkZc/hXNBkxqa7roeJCD2n//SWus2g+On17lwUJ68BOjhGTmLWr/iuwMvYhwl7gaJ9B9HzbJrlMml4RNT7MihHBSEVfeinTUWhrNSs1McWdhiPTMIs5lanJPU4uaBrdwEZuzK1onEBzTPe+vxTKUYIpNXH6LizDId5O9eQcLQgjf5IzFgkmb9UBLxL5zfagQgIZos+e9fhDeovqCGr3gR0NMRfsgbdVGhixaCVWeR6ShdQssOhsYo/YOajpR3ErmzwkLyHw8MO1rLu1jWJqyRFfqOvO5N6Ec/I9XB5iEOnYyUarldt9kkzIRjJoXfneWOy4X3nC3CrkxdpUZG6Gnr6Qe2/7bQjwJWGnO5BrXgVM0kNR1CenMwT/zHVSLpBcwvn9/v8cNHD7nNLE06kBJ9Pf1yJGsTbL2ku 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)(3002001)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:BN3PR0701MB1378;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1378; X-Microsoft-Exchange-Diagnostics: 1;BN3PR0701MB1378;4:thnNMgvqYdCeK1kVKl9CwDpST3mgW9QxL63iQN474udjypBN1QT8IHHjrqMEDRbnuZm7dlkK19pYlEhW0yOCUW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PyC9fg3EOjZR2AmsOL1YxxD1FhJW56kJHDUPywyafh2iznHLVkRzz6H/0EOXsQ4AHQDrPRmJp9NHLXHn2FfHu/PKgRbL9v31nuGfFs8f2/HnNXDn2Bo2x6mx2v7ubEPzeXQwvEItM7awQw==;5:h/UC1qI7gBQgwxGHbCOVY4sgAtNCCZZNCPZaNlzVx8RffRsKQOsu79UJCrqOnVkRR8ASDNVgXzC5Q0/jJR4uwurdBOTozTGm9HRVZurMWtgwjNfou/F/QWeOOcIBMVqolCi9E8No9sFLovX68QdjY9VO2LTArQsoJECqqnR7TZM=;7:3kMP+BovuEQArj3hN6iqhN8/6zwcNqVaG++N8nUshr3vOGENmkRpqxPwKfggSYZ1f3FjOhKlqq0F5hit2XNDqNqeRecCdfpl/UEXH+Pl556MePVc16dyM07rzlw+U/1hss6aG8zWo6PTbCmJ6VFJ/I0pt15uQxH2KOYh6CNmW6jKSVcZoy5TwM4d5RSH8DHXTc2aARvJHPzkcrJcrJlhvWWkRzct95Op5FUU89d8MkPvebJCpOXSZTZEx4xOX1Ch SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:10.5909 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4441658a-c503-4ba7-1243-08d5f8b4edaa 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: BN3PR0701MB1378 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 4f9c315813df..f9036004f179 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) {