From patchwork Wed Oct 20 21:14:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59D09C433EF for ; Wed, 20 Oct 2021 21:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37183611ED for ; Wed, 20 Oct 2021 21:14:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230359AbhJTVQk (ORCPT ); Wed, 20 Oct 2021 17:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbhJTVQk (ORCPT ); Wed, 20 Oct 2021 17:16:40 -0400 Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54CC5C06161C for ; Wed, 20 Oct 2021 14:14:25 -0700 (PDT) Received: by mail-pg1-x52d.google.com with SMTP id 75so23669180pga.3 for ; Wed, 20 Oct 2021 14:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nGHfXjRS7IjEqltOU7IXsTSN/E9GxWWSNNmXRLXSYQQ=; b=oIPCiRrltm2Zw4c7yfbM+rXJFIFKiqZi60Kt258283mP4Pz1XqwT7b8mGudyBy53cM nA6h3cJBlYpkJKDQsDt0EtMhcRKAcAEe7QgJorpJZi3iTfrCDbqmTAajX7j+yQNiqJ80 rXqzDpcCu1tiyKeovkIr8YHykcC2P5Ux9hy6HyFLeNj6oiR4k2EfzxIJ6ZPVHZIxe0xU AQEJu5UhmiLrkiGQA9meGYfQx6sVPyVQxxdsdx/unIhUX8GF5JVuTzYssa9jOAS51CGA mqq6vz34XTFcAW+oqE5upPJeMB1X4pTHz8fCBQWHn7UaBujLj72Y4iSqZ9ueIXNtrW/K L4jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nGHfXjRS7IjEqltOU7IXsTSN/E9GxWWSNNmXRLXSYQQ=; b=I9TOstQY049qr6mSvkCAeIjQYSsQocd1G+1fa+UriUo/9cNHqgvNi/GMz6DEJaeLn/ WZZ4g/2fD8Oj0Rl/dje3yUe3pKIXzeVb5SoWXNp+KKffCtQym2wg80N8Kd8DVbV5/Of+ gUdqQt3uK/bty50UODCMIE52VPt7pSXu5KWZ5KRnzHvKHkIIUgU4B9OIa0Bs2rGXcfUg 1XHaO1CxsgEDxSHwgb7c7+FZ11YWFE3nHIGAJbRj83gIg7l+Js6vxE0FlKmkuTlCjYFr R7+YURi9BTl3d/crjiFl3P2ojqH/F/yksTYkN7iWsEyAWnNFkDw2p+G8YUbCjrlwiNiQ noNg== X-Gm-Message-State: AOAM533CveUq0b9l0HNqqLc5/7a6F5QGzliGqYRT6hO9LK659QWtfKNN W8BKGKac+35lcAumbgIbbNhkvn1izyI= X-Google-Smtp-Source: ABdhPJwCSVMb6K8x8Q9hMDWDOgZVkPmArIePcFuqiwHA2bxU+d1pIiE16YHgqcOcp8+4tV9oPYXVOQ== X-Received: by 2002:a63:370c:: with SMTP id e12mr1254599pga.359.1634764464726; Wed, 20 Oct 2021 14:14:24 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:24 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee , Zheyu Ma Subject: [PATCH 1/8] lpfc: Revert LOG_TRACE_EVENT back to LOG_INIT prior to driver_resource_setup Date: Wed, 20 Oct 2021 14:14:10 -0700 Message-Id: <20211020211417.88754-2-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org In cases when lpfc_enable_pci_dev fails, lpfc_printf_log with LOG_TRACE_EVENT set will call lpfc_dmp_dbg which uses the phba->port_list_lock. However, phba->port_list_lock does not get initialized until lpfc_setup_driver_resource_phase1. Thus, any initialization routine with LOG_TRACE_EVENT log message prior to lpfc_setup_driver_resource_phase1 will crash. Revert LOG_TRACE_EVENT back to LOG_INIT for all log messages in routines prior to lpfc_setup_driver_resource_phase1. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart CC: Zheyu Ma --- drivers/scsi/lpfc/lpfc_init.c | 6 +++--- drivers/scsi/lpfc/lpfc_scsi.c | 2 +- drivers/scsi/lpfc/lpfc_sli.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b7de66f89b3b..5e959c4f05c2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -7385,7 +7385,7 @@ lpfc_enable_pci_dev(struct lpfc_hba *phba) out_disable_device: pci_disable_device(pdev); out_error: - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "1401 Failed to enable pci device\n"); return -ENODEV; } @@ -8428,7 +8428,7 @@ lpfc_init_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) phba->lpfc_stop_port = lpfc_stop_port_s4; break; default: - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "1431 Invalid HBA PCI-device group: 0x%x\n", dev_grp); return -ENODEV; @@ -11661,7 +11661,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba) /* There is no SLI3 failback for SLI4 devices. */ if (bf_get(lpfc_sli_intf_valid, &phba->sli4_hba.sli_intf) != LPFC_SLI_INTF_VALID) { - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "2894 SLI_INTF reg contents invalid " "sli_intf reg 0x%x\n", phba->sli4_hba.sli_intf.word0); diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 83ad03d22a49..f35246024988 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -5115,7 +5115,7 @@ lpfc_scsi_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) phba->lpfc_scsi_prep_cmnd_buf = lpfc_scsi_prep_cmnd_buf_s4; break; default: - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "1418 Invalid HBA PCI-device group: 0x%x\n", dev_grp); return -ENODEV; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index d800c6a69c95..244e7d68428e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -10026,7 +10026,7 @@ lpfc_mbox_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) phba->lpfc_sli_brdready = lpfc_sli_brdready_s4; break; default: - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "1420 Invalid HBA PCI-device group: 0x%x\n", dev_grp); return -ENODEV; @@ -11194,7 +11194,7 @@ lpfc_sli_api_table_setup(struct lpfc_hba *phba, uint8_t dev_grp) phba->__lpfc_sli_issue_fcp_io = __lpfc_sli_issue_fcp_io_s4; break; default: - lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "1419 Invalid HBA PCI-device group: 0x%x\n", dev_grp); return -ENODEV; From patchwork Wed Oct 20 21:14:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BEDCC433F5 for ; Wed, 20 Oct 2021 21:14:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 40AF261215 for ; Wed, 20 Oct 2021 21:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231286AbhJTVQm (ORCPT ); Wed, 20 Oct 2021 17:16:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229842AbhJTVQk (ORCPT ); Wed, 20 Oct 2021 17:16:40 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19226C06161C for ; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id j190so16906374pgd.0 for ; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YZS5jfX+Flbh6EjHM1maWAKt2rr2jQ3nB3NgEKLe1+8=; b=HmC/9rE1bOqHLfxcg9UIe4UthQTRU0nuHrSITp7tcIW/QKVLBLae9NLofNtvntjzM1 A4SXj6FzB+1ixB1WB1JRk2HDu/tDolCZwwsPssH1Kxuy+6ulQsYVRW1JKBGlDRAGvMxZ PLQz7MVbVYlfBbIui61Tcj1K19RX9KEHNn1wpuCxCeqckkH8FRtLsmIQ8SBUoZ1mkzv/ VRk8RXWSpQL6ZBvW1uOUGWBA4kS555JUp+SLGJ9aT+0NNtzPYx1qiH9R7pVv80tlOAGr Xz5z2FM6QYqf73JrVVcUwBJNu4c9cPEKy/209CVZ3bx1HCIpejqTnkWbIm98G/Fbfa06 wkRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZS5jfX+Flbh6EjHM1maWAKt2rr2jQ3nB3NgEKLe1+8=; b=Gt3Jyv+9IVord6nL0VVleBhHCzNi9QuEvEFyzesapAgqq+gra2GT7OrtzSvxBEbR/o cWJy2uwN0XZ4IiMfM23+JVVjVd6Rn+fZ5RZBzpLjX000joZkZsfhEQIPNtqdc4goXNA8 rrmHroMP7wLAbXI426H192IxzuCg/n766il8EAzG69KY7ciDTiBJdLiEfVDIFq4aC5K3 bvnpBhdECM7QcyU0IXlnnMfoVTZufeXj1sxzdYAxCkS2G/3DSAUMOj0/+QTDWUfGbtQ9 y2HxDig7OsNM9EuaSz8cqhDsb7Qq01r/Y3DT9YXF6dirsNl9kDBSbj0xo5BMAD8QuJSW IinA== X-Gm-Message-State: AOAM532+NIjSqLAy9q4QIIAeUXkD/12qotFcOQ+pbqVZm7CgQUcd5Xz+ uqLF2mC7Jf+DBBHCXWAmEdck6OXp3aM= X-Google-Smtp-Source: ABdhPJzg8wYSeW06l2KRaKwzi8P6m0MNkapd2vMGQssQMWe7E4/0Ayfuzf44XWTQ4BrFwKrjkaiagw== X-Received: by 2002:a63:7888:: with SMTP id t130mr1255338pgc.279.1634764465547; Wed, 20 Oct 2021 14:14:25 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:25 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 2/8] lpfc: Wait for successful restart of SLI3 adapter during host sg_reset Date: Wed, 20 Oct 2021 14:14:11 -0700 Message-Id: <20211020211417.88754-3-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org A prior patch introduced HBA_NEEDS_CFG_PORT flag logic, but in lpfc_sli_brdrestart_s3 code path, right after HBA_NEEDS_CFG_PORT is set, the phba->hba_flag is cleared in lpfc_sli_brdreset. Fix by calling lpfc_sli_chipset_init to wait for successful restart of the HBA in lpfc_host_reset_handler after lpfc_sli_brdrestart. lpfc_sli_chipset_init sets the HBA_NEEDS_CFG_PORT flag so that the lpfc_sli_hba_setup routine from lpfc_online will execute lpfc_sli_config_port initialization step when the brdrestart is successful. Fixes: d2f2547efd39 ("scsi: lpfc: Fix auto sli_mode and its effect on CONFIG_PORT for SLI3") Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_scsi.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index f35246024988..0dce4b51ca1e 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -6648,6 +6648,13 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd) if (rc) goto error; + /* Wait for successful restart of adapter */ + if (phba->sli_rev < LPFC_SLI_REV4) { + rc = lpfc_sli_chipset_init(phba); + if (rc) + goto error; + } + rc = lpfc_online(phba); if (rc) goto error; From patchwork Wed Oct 20 21:14:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52C26C433F5 for ; Wed, 20 Oct 2021 21:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AEF6611ED for ; Wed, 20 Oct 2021 21:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231297AbhJTVQm (ORCPT ); Wed, 20 Oct 2021 17:16:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbhJTVQl (ORCPT ); Wed, 20 Oct 2021 17:16:41 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8D7EC061749 for ; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id t11so17019447plq.11 for ; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S6DlPNxkV/Vag66qy/kbG/ox5sepfKSY71OUbEMKlnA=; b=WmP/shePr3C+EIr0RJkEtyZSk4he37HqZoGAbmRWDSmBZVxERN64cCqjiCfLjjJd+Q auwlN/5Xle6a9v5pMHjvxzMZeOoNmpCosFmB8dLa2u34hiPXPV5e5IkauECM+a8qQ3zQ zLbXO3b88t+/QD74/VsnA+9CR105n60kBXe/8tgVyoI2dGesfoJnL1gTCetFrF6U0EFU Eq0snktdv06F0d1es/e+eUC7SXoPctrf3tkh0MmVAoTY0/2wkKAEEcjpfenuTr5iPPM/ xp/aN5nooP2IIoPNDAPvysdB9dyET4DHgGwjJGa9LM8t/FWdjvcd4Fhu8x9zp8mWN7lG qTGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S6DlPNxkV/Vag66qy/kbG/ox5sepfKSY71OUbEMKlnA=; b=hG2ZVm29AyDZyAVte7k2iI8iqn5kSS6gQeNrzxACWLh/SjjiUm/Uo2Ua0yBumHd2UH dzAt+SwSWxYShwP8/z8dNchNSLZBFoUisZCHvkSBRVN8+Tcs5Wa3hKHAd/A5mbbTCwsg ZKJSw9OElfwpRSr4FJBB6IIC0oEfowPAKp/PBch9gYe1f2CwQPG+ez3T8dgmQZ5xqMin VxbciBOZkOFPLkqkT58xYQ4qXeB+THuOrL8kVlJUwv1/mxY0sEBdSlL+C8CniDBguu9c uJUGYrE3M8MqpO0qJQlKmFwVJX4yPV01E0PZO21cWjHcoTPoWedEHqbklsDSwrogwedR lsRg== X-Gm-Message-State: AOAM530AtLwNxd5quu4Jp6YhS0Gx4KA5b1n2LZBJ20eTvHCHheuD+5Cw q+9ebVXS3EyqY4NgnpYkRM1l651dk1M= X-Google-Smtp-Source: ABdhPJwu1JJ5z/yUDjyx88DzioULeXNxtiSTfuImliL96sLR3Z/cYmy9xfo/rzeo7mbtm4iPj7+oaw== X-Received: by 2002:a17:90b:4c88:: with SMTP id my8mr1455036pjb.49.1634764466244; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:25 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 3/8] lpfc: Correct sysfs reporting of loop support after SFP status change Date: Wed, 20 Oct 2021 14:14:12 -0700 Message-Id: <20211020211417.88754-4-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Applications determine loop support in part by querying the 'pls' sysfs node. Reporting of 'pls' (Private Loop Support) is derived from the descriptor returned by the COMMON_GET_SLI4_PARAMETERS mailbox command, which is issued during initialization or after a reset. The value of this field may change if there is a dynamic SFP change. The driver currently will not pick up the change as there was no reset scenario. Rework to commonize the sending of the COMMON_GET_SLI4_PARAMETERS command. Add the calling of the routine after receipt of an async event indicating an SFP change. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_crtn.h | 1 + drivers/scsi/lpfc/lpfc_init.c | 50 +++++++++++++++++++++++++++++++++++ drivers/scsi/lpfc/lpfc_sli.c | 25 +++--------------- 3 files changed, 55 insertions(+), 21 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index c512f4199142..f0bcfeecd161 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -205,6 +205,7 @@ void lpfc_delayed_disc_timeout_handler(struct lpfc_vport *); int lpfc_config_port_prep(struct lpfc_hba *); void lpfc_update_vport_wwn(struct lpfc_vport *vport); int lpfc_config_port_post(struct lpfc_hba *); +int lpfc_sli4_refresh_params(struct lpfc_hba *phba); int lpfc_hba_down_prep(struct lpfc_hba *); int lpfc_hba_down_post(struct lpfc_hba *); void lpfc_hba_init(struct lpfc_hba *, uint32_t *); diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 5e959c4f05c2..744da35b5074 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -662,6 +662,50 @@ lpfc_config_port_post(struct lpfc_hba *phba) return 0; } +/** + * lpfc_sli4_refresh_params - update driver copy of params. + * @phba: Pointer to HBA context object. + * + * This is called to refresh driver copy of dynamic fields from the + * common_get_sli4_parameters descriptor. + **/ +int +lpfc_sli4_refresh_params(struct lpfc_hba *phba) +{ + LPFC_MBOXQ_t *mboxq; + struct lpfc_mqe *mqe; + struct lpfc_sli4_parameters *mbx_sli4_parameters; + int length, rc; + + mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); + if (!mboxq) + return -ENOMEM; + + mqe = &mboxq->u.mqe; + /* Read the port's SLI4 Config Parameters */ + length = (sizeof(struct lpfc_mbx_get_sli4_parameters) - + sizeof(struct lpfc_sli4_cfg_mhdr)); + lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON, + LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS, + length, LPFC_SLI4_MBX_EMBED); + + rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); + if (unlikely(rc)) { + mempool_free(mboxq, phba->mbox_mem_pool); + return rc; + } + mbx_sli4_parameters = &mqe->un.get_sli4_parameters.sli4_parameters; + phba->sli4_hba.pc_sli4_params.mi_ver = + bf_get(cfg_mi_ver, mbx_sli4_parameters); + phba->sli4_hba.pc_sli4_params.cmf = + bf_get(cfg_cmf, mbx_sli4_parameters); + phba->sli4_hba.pc_sli4_params.pls = + bf_get(cfg_pvl, mbx_sli4_parameters); + + mempool_free(mboxq, phba->mbox_mem_pool); + return rc; +} + /** * lpfc_hba_init_link - Initialize the FC link * @phba: pointer to lpfc hba data structure. @@ -6455,6 +6499,12 @@ lpfc_sli4_async_sli_evt(struct lpfc_hba *phba, struct lpfc_acqe_sli *acqe_sli) "3194 Unable to retrieve supported " "speeds, rc = 0x%x\n", rc); } + rc = lpfc_sli4_refresh_params(phba); + if (rc) { + lpfc_printf_log(phba, KERN_ERR, LOG_SLI, + "3174 Unable to update pls support, " + "rc x%x\n", rc); + } vports = lpfc_create_vport_work_array(phba); if (vports != NULL) { for (i = 0; i <= phba->max_vports && vports[i] != NULL; diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 244e7d68428e..f82f809617a0 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -7891,36 +7891,19 @@ static int lpfc_cmf_setup(struct lpfc_hba *phba) { LPFC_MBOXQ_t *mboxq; - struct lpfc_mqe *mqe; struct lpfc_dmabuf *mp; struct lpfc_pc_sli4_params *sli4_params; - struct lpfc_sli4_parameters *mbx_sli4_parameters; - int length; int rc, cmf, mi_ver; + rc = lpfc_sli4_refresh_params(phba); + if (unlikely(rc)) + return rc; + mboxq = (LPFC_MBOXQ_t *)mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (!mboxq) return -ENOMEM; - mqe = &mboxq->u.mqe; - - /* Read the port's SLI4 Config Parameters */ - length = (sizeof(struct lpfc_mbx_get_sli4_parameters) - - sizeof(struct lpfc_sli4_cfg_mhdr)); - lpfc_sli4_config(phba, mboxq, LPFC_MBOX_SUBSYSTEM_COMMON, - LPFC_MBOX_OPCODE_GET_SLI4_PARAMETERS, - length, LPFC_SLI4_MBX_EMBED); - - rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL); - if (unlikely(rc)) { - mempool_free(mboxq, phba->mbox_mem_pool); - return rc; - } - /* Gather info on CMF and MI support */ sli4_params = &phba->sli4_hba.pc_sli4_params; - mbx_sli4_parameters = &mqe->un.get_sli4_parameters.sli4_parameters; - sli4_params->mi_ver = bf_get(cfg_mi_ver, mbx_sli4_parameters); - sli4_params->cmf = bf_get(cfg_cmf, mbx_sli4_parameters); /* Are we forcing MI off via module parameter? */ if (!phba->cfg_enable_mi) From patchwork Wed Oct 20 21:14:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE14BC433EF for ; Wed, 20 Oct 2021 21:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C8D2161284 for ; Wed, 20 Oct 2021 21:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231313AbhJTVQo (ORCPT ); Wed, 20 Oct 2021 17:16:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231284AbhJTVQm (ORCPT ); Wed, 20 Oct 2021 17:16:42 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AC18C06161C for ; Wed, 20 Oct 2021 14:14:27 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id gn3so3415371pjb.0 for ; Wed, 20 Oct 2021 14:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hKF12mEwxEHSFypa09hDmUDzypGCfCd20ZJONrZg0CI=; b=htakT7nHklPdlf1GRzgKftRTbssTa/5b3OhnwQNotQbThi1z6TYC99SeB8rtWV1Iy9 /rxT/5fd7gnlxwV7dM7Swa+97pvX4JF7qAbFoWQBU4aV+MFLjYk+TQW9fMk+jFq/ceDB YMxNsZoHLuSlqw62A/T3VPFuUDzljgvOM1wwNBOK8C708cKuVCIv7Y8DKp/2VSP8ri9N OqckF7ElZlATm0l3gsMrMOclZAOJkMCx6zQXnOTN/y2TdNxh9oAA8i/EtsepMhpZJ5rn XP9P0P1Vn3WZrUi3+EtiggrngYOJznA1uEs9TEK8JrYmVJf+i03taGZxI5uevoh+/I0t lydA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hKF12mEwxEHSFypa09hDmUDzypGCfCd20ZJONrZg0CI=; b=HFVa5SP/ooaubbIU9tpxT4opozJi3kJ5BwjdWFyOyCOowyBmfpVvUDi6fdpnfbU0kC DL2wMQUW2qZshmeWQS6CxR0TSwitiM/Yo4Afd9yArvK1JlsUmI53WPmX3bQmvknyoPRw 28haFnqYrCbhR8V50sI9cYGjFVLKXZrex0pK6GpM3Rrs9wmwY2Cjadhmi3++ur2mRUcD G6DcwTYwTYtg3esWS7tOWR7o8A2Nw3gUP8UxOS/p8NjxmmcakN73OMlr+eanPEFOGsbA PR7lIlbLgAJf6eTtbexqpBZPoLy/Qji0I+lTvaDUtUrtJEwyqrreDt60sN8URAg1ym7b lxeg== X-Gm-Message-State: AOAM5306z/3vtNdxrJmDPauKxeMD2OAsvhNLHkV18hTlk4F1gzMieI+Q zWCfecPDMyYTir4nxI1bAdfxPEmQpnc= X-Google-Smtp-Source: ABdhPJzUFls2ZOOcLWMvGmhczB4CX4L1IoWr4fSTO7D1cH27PVr4Dvuiac+3JW0cpq1fX41zVeHjnA== X-Received: by 2002:a17:90a:6782:: with SMTP id o2mr1588247pjj.165.1634764466830; Wed, 20 Oct 2021 14:14:26 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:26 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 4/8] lpfc: Fix use-after-free in lpfc_unreg_rpi() routine Date: Wed, 20 Oct 2021 14:14:13 -0700 Message-Id: <20211020211417.88754-5-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org An error is detected with the following report when unloading the driver: "KASAN: use-after-free in lpfc_unreg_rpi+0x1b1b" The NLP_REG_LOGIN_SEND nlp_flag is set in lpfc_reg_fab_ctrl_node(), but the flag is not cleared upon completion of the login. This allows a second call to lpfc_unreg_rpi() to proceed with nlp_rpi set to LPFC_RPI_ALLOW_ERROR. This results in a use after free access when used as an rpi_ids array index. Fix by clearing the NLP_REG_LOGIN_SEND nlp_flag in lpfc_mbx_cmpl_fc_reg_login(). Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_hbadisc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 0b1e1cc00e01..4c068fbb550a 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -4372,6 +4372,7 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) ndlp->nlp_state); ndlp->nlp_flag |= NLP_RPI_REGISTERED; + ndlp->nlp_flag &= ~NLP_REG_LOGIN_SEND; ndlp->nlp_type |= NLP_FABRIC; lpfc_nlp_set_state(vport, ndlp, NLP_STE_UNMAPPED_NODE); From patchwork Wed Oct 20 21:14:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EF74C433F5 for ; Wed, 20 Oct 2021 21:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 573936128B for ; Wed, 20 Oct 2021 21:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231352AbhJTVQw (ORCPT ); Wed, 20 Oct 2021 17:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbhJTVQm (ORCPT ); Wed, 20 Oct 2021 17:16:42 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17671C06161C for ; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id s1so15208511plg.12 for ; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wbgHc5/zQAPVZfDjDzvVnkCM6EMKvzGucUYr+dZwcoc=; b=A8bhOxzhEHpbbUmrux470QkGlPjOb6Il8aJf9B5kYfYnQE2Pa7/6njd7335qQ/ZnCE vJ4jeRb8WXTbvF8DoLVbwUg9zWMD8GnBVDBAvg1ftWw7hKOhOsXmKFEIgbYFacfNJ+i2 SDgnKI5kZQWnmzncWpvIHeViM9KGVmDM769OGwOSLoUKouDVg2bbYFiWImFdDex3wvaA 2e1hCI4gWG/R9xeZ4bnK5zcFmFRI+6WKxVwIojXWhJENwkW8XmHtAYQkVNYIWw9O5Pws cNgOUowUG4Pd0aWDCHxUMObwe7t76oAjetTd6b+HFwNu6g19FpY762l2ILi6OEVwfE9O lW6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wbgHc5/zQAPVZfDjDzvVnkCM6EMKvzGucUYr+dZwcoc=; b=itArf9Q2vE6pmHqoNGHJG9Gok1ufOqPO4r6iiqjhXwQWfzGGFAJ0sXK66edauxvNOz EDiHpn22tWkFxbR72B/ivDkRPOhvXl25e812JsjXAnHIwG+iqkxGsOERwbhow50eKYs1 j6H2KWb2GKhpe9d5bJgsve1oGhxtjZxWFBehx9aI5pDlvrD71r1Jr0jfp71RfNSdAZt8 aiY83D3ghKaR6esPPLJesbxraIWK9k6/3mmCzND/b0IiOxx3XaDUTozGeyJQ3k4PN1iX dgIZ9Dm8nrNb4EPINnok+3Eipmhj/AlRgkqUNxMIenD7fSVbLdwyA1gjhrwLewR6qF7H xVhg== X-Gm-Message-State: AOAM533aV/hs4hh+v6vpteuUKSybMChVhRSmUqSzAXyPWnVw65iB3Qnk +wH0+gXGmRA26tpQJogzAZvdUKWrPQc= X-Google-Smtp-Source: ABdhPJzKwPwzWDMvHkxSSFwCsZxWh3hAKKWIIN0tpshXtelsVaQ8zxUDIEoRdb5HbCcCEiJ4x8RnGQ== X-Received: by 2002:a17:90a:b105:: with SMTP id z5mr1607674pjq.64.1634764467446; Wed, 20 Oct 2021 14:14:27 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:27 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 5/8] lpfc: Allow PLOGI retry if previous PLOGI was aborted Date: Wed, 20 Oct 2021 14:14:14 -0700 Message-Id: <20211020211417.88754-6-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org A remote nport can stop responding to PLOGI beyond the ELS IO timeout under some fault conditions. When this happens, the non-response triggers a dev_loss_tmo event from the transport which causes the driver to abort the PLOGI and stop any retries. This was due to a policy in the ELS completion handler whenever an ELS was terminated due to driver request. Revise the ELS completion path to detect PLOGI's that were aborted and allow retries. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_els.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index de38f4b886ca..746fe9772453 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -4577,6 +4577,19 @@ lpfc_els_retry(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, retry = 1; delay = 100; break; + case IOERR_SLI_ABORTED: + /* Retry ELS PLOGI command? + * Possibly the rport just wasn't ready. + */ + if (cmd == ELS_CMD_PLOGI) { + /* No retry if state change */ + if (ndlp && + ndlp->nlp_state != NLP_STE_PLOGI_ISSUE) + goto out_retry; + retry = 1; + maxretry = 2; + } + break; } break; From patchwork Wed Oct 20 21:14:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573385 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09DAC433EF for ; Wed, 20 Oct 2021 21:14:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CAF1161284 for ; Wed, 20 Oct 2021 21:14:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231338AbhJTVQw (ORCPT ); Wed, 20 Oct 2021 17:16:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231310AbhJTVQo (ORCPT ); Wed, 20 Oct 2021 17:16:44 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7CBAC061749 for ; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id t21so8983950plr.6 for ; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=umOpU67khKNbJoJIeW5eB8eN825/mrgzUU4aCVjEX3c=; b=dc3bUiuKFbq5gdv+Wzp0tbXQXLV621lABmwiaHpjlYBY3ZSWVSu98YR1kybqW4Xzdc GFaBzNjknwPnsq+9d8Zx35mF5lBXrUSpWogLntcaboUuvF+Wd2ak8o2Ock0yPiy4wYo7 7DO7uIH9BmpxXd2eH4HKbwwpmVL+FkRN5gp21Jf87Z3Cxeoh7uQUxt1iiEOd9pqIWs/E 5zSEhUvfID5PiO2EyIqK7iRpWxgWwzfa9sGH1P+Dd27GyFrcnOD7qKCis4AqGqx74RGl e3tt5nIp4PwV8q17UbSXHuW8xhcU+raVXvAPTVGCnmQewHdeee3GnTC3fO1MW4/+1X8j SsKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=umOpU67khKNbJoJIeW5eB8eN825/mrgzUU4aCVjEX3c=; b=m89FR7vbiCxQvlwn3KPlaabxQ8UXBPAoQvDyy74SS8ddteCEggpsLDBpjhgx9sTqbd /NeGpQ/9jpLhywJlsIYdZR3lOL6cr0ZJpcU0yFsUy9VJmr0WacvZ1cfFUKp+z3rD+PMx amD0R+1lrwEx7dS1PjW6BeLLbZ/CfBxYcl0QZelkFDTGscaBMQEuJVpVthkPIUZRI9pV yWE9Nb7Mc6BNKtE8uC2e3JiY/2me4hsKqQ5c8H3/gzAoWsuf9cmCbHn/EMqGzukXHC2d 8l02TYyoZuXt9IHQJM2SN/jvt18B44fewKe10ARfGyaohj1klth3Jrzq/IBXF2JuJTFB ACGw== X-Gm-Message-State: AOAM532wVk6LFc6i/H0+HjzgWK6VO7SCByVWwHDh8r8Z0JGJBkBi+LDV m+PHLZgDHzQNrE2NG1ykS7rG5nXiKes= X-Google-Smtp-Source: ABdhPJyIf56oPLtEOC4+gvNwv+S/8Z2hPsAa9Of9d9EBiE4iYbpLbXdT5iYk/nKBpA3+CmRjW1WU6g== X-Received: by 2002:a17:902:e883:b0:13f:1393:d185 with SMTP id w3-20020a170902e88300b0013f1393d185mr1404098plg.64.1634764468247; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:27 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 6/8] lpfc: Fix link down processing to address NULL pointer dereference Date: Wed, 20 Oct 2021 14:14:15 -0700 Message-Id: <20211020211417.88754-7-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org If an FC link down transition while PLOGIs are outstanding to fabric well known addresses, outstanding ABTS requests may result in a NULL pointer dereference. Driver unload requests may hang with repeated "2878" log messages. The Link down processing results in ABTS requests for outstanding ELS requests. The Abort WQEs are sent for the ELS's before the driver had set the link state to down. Thus the driver is sending the Abort with the expectation that an ABTS will be sent on the wire. The Abort request is stalled waiting for the link to come up. In some conditions the driver may auto-complete the ELS's thus if the link does come up, the Abort completions may reference an invalid structure. Fix by ensuring that Abort set the flag to avoid link traffic if issued due to conditions where the link failed. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_sli.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index f82f809617a0..5dedb3de271d 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -12403,17 +12403,17 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, /* ABTS WQE must go to the same WQ as the WQE to be aborted */ abtsiocbp->hba_wqidx = cmdiocb->hba_wqidx; - if (cmdiocb->iocb_flag & LPFC_IO_FCP) { - abtsiocbp->iocb_flag |= LPFC_IO_FCP; - abtsiocbp->iocb_flag |= LPFC_USE_FCPWQIDX; - } + if (cmdiocb->iocb_flag & LPFC_IO_FCP) + abtsiocbp->iocb_flag |= (LPFC_IO_FCP | LPFC_USE_FCPWQIDX); if (cmdiocb->iocb_flag & LPFC_IO_FOF) abtsiocbp->iocb_flag |= LPFC_IO_FOF; - if (phba->link_state >= LPFC_LINK_UP) - iabt->ulpCommand = CMD_ABORT_XRI_CN; - else + if (phba->link_state < LPFC_LINK_UP || + (phba->sli_rev == LPFC_SLI_REV4 && + phba->sli4_hba.link_state.status == LPFC_FC_LA_TYPE_LINK_DOWN)) iabt->ulpCommand = CMD_CLOSE_XRI_CN; + else + iabt->ulpCommand = CMD_ABORT_XRI_CN; if (cmpl) abtsiocbp->iocb_cmpl = cmpl; From patchwork Wed Oct 20 21:14:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573389 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 05695C43217 for ; Wed, 20 Oct 2021 21:14:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E2BE6611ED for ; Wed, 20 Oct 2021 21:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231364AbhJTVQy (ORCPT ); Wed, 20 Oct 2021 17:16:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231311AbhJTVQo (ORCPT ); Wed, 20 Oct 2021 17:16:44 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95F93C06174E for ; Wed, 20 Oct 2021 14:14:29 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id g5so17045894plg.1 for ; Wed, 20 Oct 2021 14:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D8OxWAgnLvDzywcOpulKpGq4fQxTCtwCSRHvF3pV1Ig=; b=h+JKpwSEb/7v2cr8S68e1tmVDCQklSG2FjQnIjKPISug9KzdCwtxKH1tt2QbKfcRNt swongjrCOsA97q12EBQoX1EdCL7WnoPjGGYCVFdewk03erJeEAV5HnjW1TYMqls7SoCP uqK81m+mZP1EJHLxRdfrQ/cxdUm0QSLYilIhTrOSmSuGklczhCX6smIWjQbVhFsnIhQe Oxxa7rQrhOVJ6F8aAG2LgomCo/u95Q+9MDGA5NZebrdINKjluuUsCYJbJ6S2XkRcyUkH +1MODxC6nlr6xFiOHPJeJ2b9Jqg6l0ZH5lPKgS5JhG2UTj1pou2mV8LUMNqWIADDIPoW yh7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D8OxWAgnLvDzywcOpulKpGq4fQxTCtwCSRHvF3pV1Ig=; b=W25Aa2Wn8Zf3kf1XA8z0TuR0uAK5QHbV3mw8C6UKMQ7QRRSklAf2Sy+KCKuAJYVPB1 7Nmv1WbwLPMyDLchLn//a+bJSa4vLrQeg0QVVw8eicnC0rf+NSrvGUQzX7XNdb1kbEVb U+1DhfCngh5rHVWIaG7xWSQXJPBkXw8Q6651QPNEL21/7G6+3szkvKPooffg5TkKoUn8 l0BgpoSkr3yde2PzSDyQAxDgeUdxd1e3Ja/oa7ZGJMLwQbY5IKHa1SxTTbvbNv4VAkI5 B68lqOIvj3XIrdyRGtprWi9G2i0lsyL2Soe7xF3OJ2gVxPRPDisGXk73yxvyUWRGzm+/ utAQ== X-Gm-Message-State: AOAM532ejyg+h9GEkUlB8E3IgvyAYbcf56lk+7Mc7ZVu6nPtgQSPwswX GgP43toVAv+z1zF9UbcbCJ9/UpVltTs= X-Google-Smtp-Source: ABdhPJxgOyIagBCtcCF1kmP8H0mzovqUAOL/Ai2WiY82RD0bVN2+PIpMkljpkor71KRAvnIZQV+aFQ== X-Received: by 2002:a17:90a:cc0d:: with SMTP id b13mr1582920pju.190.1634764468949; Wed, 20 Oct 2021 14:14:28 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:28 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 7/8] lpfc: Allow fabric node recovery if recovery is in progress before devloss Date: Wed, 20 Oct 2021 14:14:16 -0700 Message-Id: <20211020211417.88754-8-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org A link bounce to a slow fabric may observe FDISC response delays lasting longer than devloss tmo. Current logic decrements the final fabric node kref during a devloss tmo event. This results in a NULL ptr dereference crash if the FDISC completes for that fabric node after devloss tmo. Fix by adding the NLP_IN_RECOV_POST_DEV_LOSS flag, which is set when devloss tmo triggers and we've noticed that fabric node recovery has already started or finished in between the time lpfc_dev_loss_tmo_callbk queues lpfc_dev_loss_tmo_handler. If fabric node recovery succeeds, then the driver reverses the devloss tmo marked kref put with a kref get. If fabric node recovery fails, then the final kref put relies on the ELS timing out or the REG_LOGIN cmpl routine. Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_crtn.h | 2 + drivers/scsi/lpfc/lpfc_disc.h | 12 +++- drivers/scsi/lpfc/lpfc_els.c | 7 +- drivers/scsi/lpfc/lpfc_hbadisc.c | 111 ++++++++++++++++++++++++++++++- drivers/scsi/lpfc/lpfc_init.c | 12 ++-- drivers/scsi/lpfc/lpfc_scsi.c | 10 +-- 6 files changed, 139 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index f0bcfeecd161..1acff46b4c60 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h @@ -119,6 +119,8 @@ int lpfc_check_sli_ndlp(struct lpfc_hba *, struct lpfc_sli_ring *, struct lpfc_nodelist *lpfc_nlp_init(struct lpfc_vport *vport, uint32_t did); struct lpfc_nodelist *lpfc_nlp_get(struct lpfc_nodelist *); int lpfc_nlp_put(struct lpfc_nodelist *); +void lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, + struct lpfc_nodelist *ndlp); void lpfc_ignore_els_cmpl(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, struct lpfc_iocbq *rspiocb); int lpfc_nlp_not_used(struct lpfc_nodelist *ndlp); diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h index 871b665bd72e..37a4b79010bf 100644 --- a/drivers/scsi/lpfc/lpfc_disc.h +++ b/drivers/scsi/lpfc/lpfc_disc.h @@ -85,6 +85,13 @@ enum lpfc_fc4_xpt_flags { NLP_XPT_HAS_HH = 0x10 }; +enum lpfc_nlp_save_flags { + /* devloss occurred during recovery */ + NLP_IN_RECOV_POST_DEV_LOSS = 0x1, + /* wait for outstanding LOGO to cmpl */ + NLP_WAIT_FOR_LOGO = 0x2, +}; + struct lpfc_nodelist { struct list_head nlp_listp; struct serv_parm fc_sparam; /* buffer for service params */ @@ -144,8 +151,9 @@ struct lpfc_nodelist { unsigned long *active_rrqs_xri_bitmap; struct lpfc_scsicmd_bkt *lat_data; /* Latency data */ uint32_t fc4_prli_sent; - u32 upcall_flags; -#define NLP_WAIT_FOR_LOGO 0x2 + + /* flags to keep ndlp alive until special conditions are met */ + enum lpfc_nlp_save_flags save_flags; enum lpfc_fc4_xpt_flags fc4_xpt_flags; diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 746fe9772453..b940e0268f96 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -2905,9 +2905,9 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, irsp = &(rspiocb->iocb); spin_lock_irq(&ndlp->lock); ndlp->nlp_flag &= ~NLP_LOGO_SND; - if (ndlp->upcall_flags & NLP_WAIT_FOR_LOGO) { + if (ndlp->save_flags & NLP_WAIT_FOR_LOGO) { wake_up_waiter = 1; - ndlp->upcall_flags &= ~NLP_WAIT_FOR_LOGO; + ndlp->save_flags &= ~NLP_WAIT_FOR_LOGO; } spin_unlock_irq(&ndlp->lock); @@ -10735,6 +10735,9 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, irsp->ulpStatus, irsp->un.ulpWord[4]); goto fdisc_failed; } + + lpfc_check_nlp_post_devloss(vport, ndlp); + spin_lock_irq(shost->host_lock); vport->fc_flag &= ~FC_VPORT_CVL_RCVD; vport->fc_flag &= ~FC_VPORT_LOGO_RCVD; diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 4c068fbb550a..9fe6e5b386ce 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -209,7 +209,12 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) spin_lock_irqsave(&ndlp->lock, iflags); ndlp->nlp_flag |= NLP_IN_DEV_LOSS; - ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; + + /* If there is a PLOGI in progress, and we are in a + * NLP_NPR_2B_DISC state, don't turn off the flag. + */ + if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE) + ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; /* * The backend does not expect any more calls associated with this @@ -340,6 +345,37 @@ static void lpfc_check_inactive_vmid(struct lpfc_hba *phba) lpfc_destroy_vport_work_array(phba, vports); } +/** + * lpfc_check_nlp_post_devloss - Check to restore ndlp refcnt after devloss + * @vport: Pointer to vport object. + * @ndlp: Pointer to remote node object. + * + * If NLP_IN_RECOV_POST_DEV_LOSS flag was set due to outstanding recovery of + * node during dev_loss_tmo processing, then this function restores the nlp_put + * kref decrement from lpfc_dev_loss_tmo_handler. + **/ +void +lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, + struct lpfc_nodelist *ndlp) +{ + unsigned long iflags; + + spin_lock_irqsave(&ndlp->lock, iflags); + if (ndlp->save_flags & NLP_IN_RECOV_POST_DEV_LOSS) { + ndlp->save_flags &= ~NLP_IN_RECOV_POST_DEV_LOSS; + spin_unlock_irqrestore(&ndlp->lock, iflags); + lpfc_nlp_get(ndlp); + lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, + "8438 Devloss timeout reversed on DID x%x " + "refcnt %d ndlp %p flag x%x " + "port_state = x%x\n", + ndlp->nlp_DID, kref_read(&ndlp->kref), ndlp, + ndlp->nlp_flag, vport->port_state); + spin_lock_irqsave(&ndlp->lock, iflags); + } + spin_unlock_irqrestore(&ndlp->lock, iflags); +} + /** * lpfc_dev_loss_tmo_handler - Remote node devloss timeout handler * @ndlp: Pointer to remote node object. @@ -358,6 +394,8 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) uint8_t *name; int warn_on = 0; int fcf_inuse = 0; + bool recovering = false; + struct fc_vport *fc_vport = NULL; unsigned long iflags; vport = ndlp->vport; @@ -394,6 +432,64 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) /* Fabric nodes are done. */ if (ndlp->nlp_type & NLP_FABRIC) { + spin_lock_irqsave(&ndlp->lock, iflags); + /* In massive vport configuration settings, it's possible + * dev_loss_tmo fired during node recovery. So, check if + * fabric nodes are in discovery states outstanding. + */ + switch (ndlp->nlp_DID) { + case Fabric_DID: + fc_vport = vport->fc_vport; + if (fc_vport && + fc_vport->vport_state == FC_VPORT_INITIALIZING) + recovering = true; + break; + case Fabric_Cntl_DID: + if (ndlp->nlp_flag & NLP_REG_LOGIN_SEND) + recovering = true; + break; + case FDMI_DID: + fallthrough; + case NameServer_DID: + if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && + ndlp->nlp_state <= NLP_STE_REG_LOGIN_ISSUE) + recovering = true; + break; + } + spin_unlock_irqrestore(&ndlp->lock, iflags); + + /* Mark an NLP_IN_RECOV_POST_DEV_LOSS flag to know if reversing + * the following lpfc_nlp_put is necessary after fabric node is + * recovered. + */ + if (recovering) { + lpfc_printf_vlog(vport, KERN_INFO, + LOG_DISCOVERY | LOG_NODE, + "8436 Devloss timeout marked on " + "DID x%x refcnt %d ndlp %p " + "flag x%x port_state = x%x\n", + ndlp->nlp_DID, kref_read(&ndlp->kref), + ndlp, ndlp->nlp_flag, + vport->port_state); + spin_lock_irqsave(&ndlp->lock, iflags); + ndlp->save_flags |= NLP_IN_RECOV_POST_DEV_LOSS; + spin_unlock_irqrestore(&ndlp->lock, iflags); + } else if (ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) { + /* Fabric node fully recovered before this dev_loss_tmo + * queue work is processed. Thus, ignore the + * dev_loss_tmo event. + */ + lpfc_printf_vlog(vport, KERN_INFO, + LOG_DISCOVERY | LOG_NODE, + "8437 Devloss timeout ignored on " + "DID x%x refcnt %d ndlp %p " + "flag x%x port_state = x%x\n", + ndlp->nlp_DID, kref_read(&ndlp->kref), + ndlp, ndlp->nlp_flag, + vport->port_state); + return fcf_inuse; + } + lpfc_nlp_put(ndlp); return fcf_inuse; } @@ -423,6 +519,14 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) ndlp->nlp_state, ndlp->nlp_rpi); } + /* If we are devloss, but we are in the process of rediscovering the + * ndlp, don't issue a NLP_EVT_DEVICE_RM event. + */ + if (ndlp->nlp_state >= NLP_STE_PLOGI_ISSUE && + ndlp->nlp_state <= NLP_STE_PRLI_ISSUE) { + return fcf_inuse; + } + if (!(ndlp->fc4_xpt_flags & NVME_XPT_REGD)) lpfc_disc_state_machine(vport, ndlp, NULL, NLP_EVT_DEVICE_RM); @@ -4363,6 +4467,8 @@ lpfc_mbx_cmpl_fc_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) goto out; } + lpfc_check_nlp_post_devloss(vport, ndlp); + if (phba->sli_rev < LPFC_SLI_REV4) ndlp->nlp_rpi = mb->un.varWords[0]; @@ -4540,9 +4646,10 @@ lpfc_nlp_counters(struct lpfc_vport *vport, int state, int count) void lpfc_nlp_reg_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) { - unsigned long iflags; + lpfc_check_nlp_post_devloss(vport, ndlp); + spin_lock_irqsave(&ndlp->lock, iflags); if (ndlp->fc4_xpt_flags & NLP_XPT_REGD) { /* Already registered with backend, trigger rescan */ diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 744da35b5074..df3edbe2b2e5 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3753,12 +3753,16 @@ lpfc_offline_prep(struct lpfc_hba *phba, int mbx_action) lpfc_disc_state_machine(vports[i], ndlp, NULL, NLP_EVT_DEVICE_RECOVERY); - /* Don't remove the node unless the + /* Don't remove the node unless the node * has been unregistered with the - * transport. If so, let dev_loss - * take care of the node. + * transport, and we're not in recovery + * before dev_loss_tmo triggered. + * Otherwise, let dev_loss take care of + * the node. */ - if (!(ndlp->fc4_xpt_flags & + if (!(ndlp->save_flags & + NLP_IN_RECOV_POST_DEV_LOSS) && + !(ndlp->fc4_xpt_flags & (NVME_XPT_REGD | SCSI_XPT_REGD))) lpfc_disc_state_machine (vports[i], ndlp, diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 0dce4b51ca1e..fe4e5f6ecc70 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -6475,28 +6475,28 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) /* Issue LOGO, if no LOGO is outstanding */ spin_lock_irqsave(&pnode->lock, flags); - if (!(pnode->upcall_flags & NLP_WAIT_FOR_LOGO) && + if (!(pnode->save_flags & NLP_WAIT_FOR_LOGO) && !pnode->logo_waitq) { pnode->logo_waitq = &waitq; pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; pnode->nlp_flag |= NLP_ISSUE_LOGO; - pnode->upcall_flags |= NLP_WAIT_FOR_LOGO; + pnode->save_flags |= NLP_WAIT_FOR_LOGO; spin_unlock_irqrestore(&pnode->lock, flags); lpfc_unreg_rpi(vport, pnode); wait_event_timeout(waitq, - (!(pnode->upcall_flags & + (!(pnode->save_flags & NLP_WAIT_FOR_LOGO)), msecs_to_jiffies(dev_loss_tmo * 1000)); - if (pnode->upcall_flags & NLP_WAIT_FOR_LOGO) { + if (pnode->save_flags & NLP_WAIT_FOR_LOGO) { lpfc_printf_vlog(vport, KERN_ERR, logit, "0725 SCSI layer TGTRST " "failed & LOGO TMO (%d, %llu) " "return x%x\n", tgt_id, lun_id, status); spin_lock_irqsave(&pnode->lock, flags); - pnode->upcall_flags &= ~NLP_WAIT_FOR_LOGO; + pnode->save_flags &= ~NLP_WAIT_FOR_LOGO; } else { spin_lock_irqsave(&pnode->lock, flags); } From patchwork Wed Oct 20 21:14:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 12573387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3481C4332F for ; Wed, 20 Oct 2021 21:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A768611ED for ; Wed, 20 Oct 2021 21:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbhJTVQx (ORCPT ); Wed, 20 Oct 2021 17:16:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbhJTVQp (ORCPT ); Wed, 20 Oct 2021 17:16:45 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CE8C061753 for ; Wed, 20 Oct 2021 14:14:30 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id nn3-20020a17090b38c300b001a03bb6c4ebso3366187pjb.1 for ; Wed, 20 Oct 2021 14:14:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0260eTtRLt2mt0F000DRQ8xDB09XLz0Zy3FRehQG09s=; b=e+4a53C2/HwJYGIOpYoq7uW8SEpngZZAbUe9zPNmogZhHSn1ZcMM9BJc8zu3uf3nnW KpSqRpqAe6YK4ndb7J5rqyG0xE10x0VOqpvvr6W9OkeRVPmlVvXg0H/2byiq4JViw6Jp B3vzhcfkpU3wXN5nlRVshfIjIqyddxJzJYhAH6FaqqXSJOxrJNQFcsX628n0wydlZQfE lThFUHc2mn6/Z8529qyFR+Cmj322tukUg8fQ35nVzcF9/BiqKjvubm8PAth3e5eenOcB tIX1oUE75hkzHeM8hAnuCZwFYQKrc5kIaBcNJ+8tUEIex356rfsL6Wq5bgkboNArOaYP bE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0260eTtRLt2mt0F000DRQ8xDB09XLz0Zy3FRehQG09s=; b=ls/mBDF4SUFdJzJb21nCIhepj5MD3GDCb85DUrYfoThkhbsv7g+tXpqVUBb6KJqDlV XHc+KseAdiBOUHJtHADvCzCTyQoGGm+eG/e/l9Zkld4oLVhcnADHRYz25+ekTSocFaYr kV996CaC/efPRP4ZCDGDRXwjmOjR+jjdn8MzTT/J2IbKrQDF9WQpIsBpT3LZF6wOm9cC OY0z36Zc09J7xmYDTfdsb69nuHb8PhfdJoS7Qx3F4Tg2BQzTX4QLE7/SLYBpFxw6eUhu UcFVdjn38qh3PA2lXBTszAPR7OsBAL43SJcSCSOgf1lF5+hWJ+7HjJZVryNxRhyuFBdG 8yNQ== X-Gm-Message-State: AOAM532H192CD3Becm6/X0A2ecUZ9SdH4J/9E1qnIa7ge+PZBHLMCehm iAFprklvkJ+W9hVDoFRAfrJB1O747yU= X-Google-Smtp-Source: ABdhPJz7PD/kRCggKSFpvx8n/N5xYr3bX8+Z+M0PGPMj7/cqJwwW6nKV3kRvDnbyxoTyGiiRp8Gy/g== X-Received: by 2002:a17:902:ab17:b0:13e:b2e0:58b with SMTP id ik23-20020a170902ab1700b0013eb2e0058bmr1371920plb.9.1634764469732; Wed, 20 Oct 2021 14:14:29 -0700 (PDT) Received: from mail-lvn-it-01.broadcom.com ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id pi9sm3700689pjb.31.2021.10.20.14.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 14:14:29 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Justin Tee Subject: [PATCH 8/8] lpfc: Update lpfc version to 14.0.0.3 Date: Wed, 20 Oct 2021 14:14:17 -0700 Message-Id: <20211020211417.88754-9-jsmart2021@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20211020211417.88754-1-jsmart2021@gmail.com> References: <20211020211417.88754-1-jsmart2021@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Update lpfc version to 14.0.0.3 Co-developed-by: Justin Tee Signed-off-by: Justin Tee Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index dec71775f677..5a4d3b24fbce 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.0.0.2" +#define LPFC_DRIVER_VERSION "14.0.0.3" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */