From patchwork Thu Aug 2 20:16:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 10554161 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 D4CC4157D for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C0EF62C444 for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B4F4E2C459; Thu, 2 Aug 2018 20:17:13 +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 513872C444 for ; Thu, 2 Aug 2018 20:17:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729224AbeHBWJy (ORCPT ); Thu, 2 Aug 2018 18:09:54 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:39648 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727302AbeHBWJx (ORCPT ); Thu, 2 Aug 2018 18:09: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=A/NVIU1D1V53iy7AKQm/v26tI8xMJqS1tlYlNtCLTpk=; b=CxtIoqt3wMc3h6Z+wkuOhebcUi9llkUanw+tqXcoVSQrnkYF/Be/uOBgKtsBSGhmTfH/NDAfI7/mWJ7jYBsQIhoWW4mMGfRd/1bceuGzGYoECvKMy0stuK3blbOIVUqkS37cBzTtwDsx4ZEAfKeCLPddm/sSr7Ctv7RfBUx1LbI= Received: from BYAPR07CA0035.namprd07.prod.outlook.com (2603:10b6:a02:bc::48) by MW2PR07MB4075.namprd07.prod.outlook.com (2603:10b6:907:7::10) 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:10 +0000 Received: from BY2NAM05FT024.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by BYAPR07CA0035.outlook.office365.com (2603:10b6:a02:bc::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend Transport; Thu, 2 Aug 2018 20:17:09 +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 BY2NAM05FT024.mail.protection.outlook.com (10.152.100.161) 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:09 +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:00 -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 w72KH011007970; 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 w72KH0u1007969; Thu, 2 Aug 2018 13:17:00 -0700 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 08/16] qla2xxx: Fix session state stuck in Get Port DB Date: Thu, 2 Aug 2018 13:16:50 -0700 Message-ID: <20180802201658.7903-9-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)(136003)(376002)(346002)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(316002)(5660300001)(50466002)(69596002)(110136005)(54906003)(81156014)(486006)(48376002)(81166006)(305945005)(2906002)(8676002)(106002)(80596001)(76176011)(51416003)(126002)(1076002)(2616005)(186003)(44832011)(16586007)(8936002)(476003)(26005)(356003)(42186006)(446003)(336012)(11346002)(14444005)(50226002)(4326008)(72206003)(36756003)(86362001)(87636003)(478600001)(47776003)(6666003)(106466001);DIR:OUT;SFP:1101;SCL:1;SRVR:MW2PR07MB4075;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;BY2NAM05FT024;1:vgpRr/ZAii1Fep/MyM6FED9+gF4XpjaVnkeRQLnSZoy6dfFkVifkES4n6uuuadoOPRAPcM0Y9UQgrZSShLPnei4d97QPfaFUMvknhqpXMp2uXycTsZbBt97SvvfIfKtb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 430e9674-9c9b-4505-7751-08d5f8b4ed11 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;3:HG5pVd+SXsNYLXVYduQJMwCEomiwtMFBIDEqbGwGhhjFvZq65TTPYgILhFqMowpj5D/il/iqv4Vq5yzskpmTf7QsbHPWjB5yxUQigNKoCvpwOjAkicJr53NWw3bjFQXJE08aehzhKsKEplVkoM34NeKROuHHnCiY1ghzYeV2LU1lmi4wP6aDuT03OoyZ+yPQLDUDnIgJizoaTDunsSaB1r5y6YejVudFU1J4Eq+l4BLlb1yYn+NkrwRWHaRSBhN/u5Gc2rXzKvxE8ONP298bi2ELvq0c1kwXlUeWZFhHGzruatO1roeEAn/NaAKA+H3Iy02qs83SJzEmAzdMJP19Q6lMShOqwa51mPHeeBst/5E=;25:zp3YD6bgvFd9ZmLf5m78j2skH6PIo8yacol5nAoB1Oy7sCGUmfjqFcoJgRrsmRNN9WMmSsYuTZTrAbTZKyUf6SKujSa0sU2D9QpbOcCdzPO/hLa4OuIh62IuaD7OlDQoilRQfJzfhfIy6Y103rRHILXMlcBzOSjPpdkNau3aUZRkfP3saFeXPcJC2oWSjnmXBEAXgZrZNc/0cD/CtDfFpxn1lsg04aowV3jsFlXOG9IOwdHXtbtxzPcFxxwJBfOreVW4m0lueeSOaRUxuI8o1O6iXN7D5KFEFIb3RRvzcBgLgAPDeccDkbjbgid/nJm7mb9u4CwCB6glwafmUnYj1A== X-MS-TrafficTypeDiagnostic: MW2PR07MB4075: X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;31:5Ay8iY37AbAzHvNgQd75aGn9A5jST/junV//JQsQ375lutxqhJDqJ1xaeYOYBN2oySkLpLYf+p5fXdeosKcaKCiSqGo9K4nT0Gyvvpzv7kQd03JhVUWdy8BLZ/3nl3YXJZc31uE6qcQYf2T6RIssimpyjGGy+d0qLM7xZt4npEFT+JPNGlYis2Wbb4QpFWvMGv2wCnAQmTKlyefnq5zn3FosT/BMcnJlPabrIWJO0pE=;20:rAsywr3YnoYcg3m/3nbDBr4SNrHbpcrCRSDBF2/60O/xM/cHHHQGmRKQ5xPMumvlYn1q8LV4DB+wRArwMMz0JoOeJufxaU3Pw5HcTexl7qeWmLJaMjJCMo4bQR5nS8roL/GiIlrOyD2DenkENbt9lunx+VTapp1/74iev00LjSIJEIXA4tUFTpDi5pdejg+OpCFBtEhAvgIqr2b/9EN4cEvrKuGjqNeTzrndDVFEprOClbx+EHS4Jmhe1Csy6tDm7qPZTmELCCBnnn+LiCKEXYHZQevQbr6X672XAMSFHN5MszdUfUi/amjLbdyNN09zndoV2qPE4HkitFUyEfhoHsMDI0ydKjDYeg2Ca32WpZDiMFD2nrER8en0EF3jIeLLRrb/63uatWl7PnxkbTBRTRE7waeCooZEvtsSaK86WURyltjQpW2qFIzKjEBXmwtvgf1m8GOcutafjoLjFSvax0lFYOWDBlv0+0eiF0dbA407YOIWcZQjJ33rZZM6Y2/Z 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)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:MW2PR07MB4075;BCL:0;PCL:0;RULEID:;SRVR:MW2PR07MB4075; X-Microsoft-Exchange-Diagnostics: 1;MW2PR07MB4075;4:3l66iIeMmoRlv+FgRRL38eYl7UyeVO8oja2VbLaFF1cyIs1GnC3xwOtDiGeGi0D6Jo3dyiT5RqAa7d5I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HZfkJJpY7/mCg5TvjpXyT1Ho/8/hdYj/KUEPuN/ar1hRrH5zCKiKKhzjt4JShWr7ObrChd66rgShyWpg6GZ2sHABFIwXvnCE7tr+yDVmV0Mv2qS7+zZHmpXw1JnRufLae0PQHgwLRrtjsg4tmp4FmoDs7Q==;5:doIfbJWzR9mbXatbPXtIt8wI674Qqa66G6gC8mmhvy6uZxlS8mJG8VeeLdFrEH9aOhiVqH8SyNBWKQdnH9zN0S9X+4bsBtu69yyxugCr1Ciye+UyB55NkKDY4hQpaCAaBXThhU2pSvHZNyOakCzFPSByLl4q+QmO6td17sZSAEQ=;7:+D2VKpPd3xSnbJvWEwm22oor5POxv0BBJV1/D1AKHcmDEETzPjvUQGE5tn4bbBxtV5vf9Jlb7r37IC2ISHTodOm2c90gFxPi7BPTYaxigFU9LIBijPOUh8XTKv7ztsyxqGc48KMWEPyWTNb8q6lBLOioflM71aYxSIg0HvE8DG2B2RlFeSpKXUg05V7Xdu+xmbsyLCI2Mt4DTnzlI9WJ8dijl4x9osRzEcHYerq2MQLRH2Qr7fG/eGi6eMfi/Sqb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 20:17:09.5752 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 430e9674-9c9b-4505-7751-08d5f8b4ed11 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: MW2PR07MB4075 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 sets discovery state back to GNL (Get Name List) when session is stuck at GPDB (Get Port DataBase). This will allow state machine to retry login and move session state ahead in discovery. Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index df55fd4e1716..bb565f556c2f 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1153,9 +1153,12 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea) case PDS_PLOGI_COMPLETE: case PDS_PRLI_PENDING: case PDS_PRLI2_PENDING: - ql_dbg(ql_dbg_disc, vha, 0x20d5, "%s %d %8phC relogin needed\n", - __func__, __LINE__, fcport->port_name); - set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + /* Set discovery state back to GNL to Relogin attempt */ + if (qla_dual_mode_enabled(vha) || + qla_ini_mode_enabled(vha)) { + fcport->disc_state = DSC_GNL; + set_bit(RELOGIN_NEEDED, &vha->dpc_flags); + } return; case PDS_LOGO_PENDING: case PDS_PORT_UNAVAILABLE: