From patchwork Fri Feb 15 22:37:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Himanshu Madhani X-Patchwork-Id: 10816053 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 DF6881575 for ; Fri, 15 Feb 2019 22:38:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CE133300C7 for ; Fri, 15 Feb 2019 22:38:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1A532E826; Fri, 15 Feb 2019 22:38:32 +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 5B97E2E826 for ; Fri, 15 Feb 2019 22:38:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391991AbfBOWic (ORCPT ); Fri, 15 Feb 2019 17:38:32 -0500 Received: from mail-eopbgr710057.outbound.protection.outlook.com ([40.107.71.57]:34841 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2390411AbfBOWib (ORCPT ); Fri, 15 Feb 2019 17:38:31 -0500 Received: from SN4PR0701CA0008.namprd07.prod.outlook.com (2603:10b6:803:28::18) by BN6PR07MB2900.namprd07.prod.outlook.com (2603:10b6:404:3f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.22; Fri, 15 Feb 2019 22:38:29 +0000 Received: from BY2NAM05FT053.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::203) by SN4PR0701CA0008.outlook.office365.com (2603:10b6:803:28::18) 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:29 +0000 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 BY2NAM05FT053.mail.protection.outlook.com (10.152.100.190) 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:28 +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:27 -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 x1FMbQKe025478; Fri, 15 Feb 2019 14:37:26 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x1FMbQ7l025477; Fri, 15 Feb 2019 14:37:26 -0800 From: Himanshu Madhani To: , CC: , Subject: [PATCH v3 01/11] qla2xxx: Fix LUN discovery if loop id is not assigned yet by firmware Date: Fri, 15 Feb 2019 14:37:12 -0800 Message-ID: <20190215223722.25439-2-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: 131947439091446657;(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)(346002)(376002)(136003)(396003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(11346002)(6346003)(5660300002)(105606002)(336012)(316002)(36906005)(47776003)(42186006)(80596001)(16586007)(54906003)(69596002)(110136005)(2906002)(26005)(50226002)(4326008)(53936002)(50466002)(51416003)(36756003)(76176011)(48376002)(498600001)(2616005)(446003)(106466001)(26826003)(1076003)(81166006)(8676002)(87636003)(126002)(86362001)(81156014)(305945005)(356004)(6666004)(68736007)(8936002)(97736004)(486006)(476003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR07MB2900;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: 46f52b06-7cc0-428a-fb9b-08d693964e7e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600110)(711020)(4605077)(2017052603328);SRVR:BN6PR07MB2900; X-MS-TrafficTypeDiagnostic: BN6PR07MB2900: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09497C15EB X-Microsoft-Exchange-Diagnostics: 1;BN6PR07MB2900;23:53ydvEYUz9cPDPAHJOrnprgAqQkf0QvoMv4f4hicCLoYdOOivU15FsPb2vrnFQ9f6P0EMDZFGnaCTCDosvxkDFr9a19i15N0nAfr/Lt2rL6fofipGdDYky7ye7B99Z5p6qQzcJPgZwYE82bGuiifZF86E13n7GVAQuHmV4wg2befw3ozwwq+XwQJmgWQ7dU53QmFIBWzuQaQmABmsS92lxcxKeous3TMvEVKwsuIyv0HHucyREA9DIRw3s08wcLoOX4EReG4ZQ4nZkU4xmcPzJp5InIXKvp7FzgTagZ7kFaOKGZA5K3jkY1I0Wqx55aN+G6XWMIZb5TsONrVYmu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xk2WKJpiTS3fEOZnHnG08a0c5jQrBVGBo1vSlOk5GFWuGyZhedZhnxsV1qXWy7OmGDv4Qh03iVQsqSLLrUA/TZGdl7SOh2XEsA3GVnO6308MswUtFZMiFFoNzvUT76AHYjN0hiKKzCNI5EsSpB0tOJ9Ki6KP3G7q6NfQdNK+R1cksUj0tBskdwCby7mr+tdFyUyRnaXOcCtsB7PNMXw1WIGM/CGzlFGU+GVXJhoTYT/NoGPvta3QYqEHRMuyMzP7lxaadOwx4= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2019 22:38:28.8294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46f52b06-7cc0-428a-fb9b-08d693964e7e 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: BN6PR07MB2900 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 This patch fixes LUN discovery when loop ID is not yet assigned by the firmware during driver load/sg_reset operations. Driver will now search for new loop id before retrying login. Fixes: 48acad099074 ("scsi: qla2xxx: Fix N2N link re-connect") Cc: stable@vger.kernel.org #4.19 Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_init.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 8307eac796a2..cdf57eb643b3 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -644,11 +644,14 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, break; case DSC_LS_PORT_UNAVAIL: default: - if (fcport->loop_id != FC_NO_LOOP_ID) - qla2x00_clear_loop_id(fcport); - - fcport->loop_id = loop_id; - fcport->fw_login_state = DSC_LS_PORT_UNAVAIL; + if (fcport->loop_id == FC_NO_LOOP_ID) { + qla2x00_find_new_loop_id(vha, fcport); + fcport->fw_login_state = + DSC_LS_PORT_UNAVAIL; + } + ql_dbg(ql_dbg_disc, vha, 0x20e5, + "%s %d %8phC\n", __func__, __LINE__, + fcport->port_name); qla24xx_fcport_handle_login(vha, fcport); break; }