From patchwork Fri May 25 04:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 10426311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8DBB8601D5 for ; Fri, 25 May 2018 04:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E4F6293C7 for ; Fri, 25 May 2018 04:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 72F7D29478; Fri, 25 May 2018 04:09:23 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 5B032293C7 for ; Fri, 25 May 2018 04:09:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932432AbeEYEJT (ORCPT ); Fri, 25 May 2018 00:09:19 -0400 Received: from mail-pf0-f174.google.com ([209.85.192.174]:33332 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751861AbeEYEJP (ORCPT ); Fri, 25 May 2018 00:09:15 -0400 Received: by mail-pf0-f174.google.com with SMTP id a20-v6so1923893pfo.0 for ; Thu, 24 May 2018 21:09:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+zpzSXAPTYvCzz9BNzK6HIABGvRL51e8te09ChQjiv4=; b=CBZiFASS+ayYLbMxE8IraHh2QIhRYPc8bR9uDHOt2e6cyYDTaghQ/VcwOlGZhuY1Fn slXP753y9JWeRovZ4cM3EwOypIpet7G3l1McMvSe5CI1ewnyrdA1AcZKx8TkekT3nZX8 rnOPCoLZkfyENI3pKhPAl491ABOuxhMa9f1gKW+xPRAD+FdILQ0EC0WYKNt3WmjKRPoZ dSp4Q8OwO1RTExVcWaVcGIOEK+ChMcJDTskOcMf0uQcrb0P9sI6sAYesGMTFZp0KwHXn DPUJpusn8Q2jWDgngtmrn5iVn2rJX5aEIt/OlXzAuCuoBd/azQGetNVPsOMvbM55iVvx Qz9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+zpzSXAPTYvCzz9BNzK6HIABGvRL51e8te09ChQjiv4=; b=b2t/fn0Apq5yWHkYrD+MhgITSqxvJ+Y3KTSObeSEEP7AejQVWamtH4zJn7DIV4x1EV YN0uYtS6iEMtdlQTEbT00wPlTjYvWjGJOcIXXxagRT+dAvCgEK6GPEjoMxpwULoIQg6b nsMBaquPQScwjbYb4jkILfvlwJecnHi2YL5OGUeiixluSjOgxqMm2MoYSp5wAPmgNzSh rerR5Uy/+FWaJ8nOwi9lzkFftYRuyCY/gb/T2IpwzxsV8hmC+hf5UDuIcpA92UgF26yC G4CHyVudFV2LieEl/vhR0/ZbuHDVc++aZbk1F6bOeAQu5t8xVzM1BIk7G6h237n9H7fV cguA== X-Gm-Message-State: ALKqPwfZndCF7u4mKC7pyV0xnhmx8qeN36s//uA/DmGeEskc/nS5wNJQ FGyG6nidiqfeqaAzq8kNQaojWA== X-Google-Smtp-Source: AB8JxZqbL+K4W+c4JnRTO8BkdGicq8u8p8gstLFe5YmyJ9jV0Z45Fz6yhLreYbO99MjxTaXOsXIg/g== X-Received: by 2002:a65:508d:: with SMTP id r13-v6mr691964pgp.134.1527221354793; Thu, 24 May 2018 21:09:14 -0700 (PDT) Received: from os42.localdomain (ip68-4-112-38.oc.oc.cox.net. [68.4.112.38]) by smtp.gmail.com with ESMTPSA id u70-v6sm48974819pfk.121.2018.05.24.21.09.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 May 2018 21:09:14 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 5/6] lpfc: Fix port initialization failure. Date: Thu, 24 May 2018 21:09:01 -0700 Message-Id: <20180525040902.22052-6-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20180525040902.22052-1-jsmart2021@gmail.com> References: <20180525040902.22052-1-jsmart2021@gmail.com> 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 The driver exits port setup after failing the lpfc_sli4_get_parameters command (messages 0356, 2541, & 1412). The older CNA adapters do not support the MBX command. In the past the code was allowed to fail and continue on with initialization. However a nvme change moved a closing bracket and now makes all failures terminal. Revise the logic so that terminal failure only occurs if the command failed on the newer adapters. Additionally, if parameters are set that require information from the command and the command failed, the parameters are erroneous and port set up should fail even on the older adapters. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 48a5f067cec6..7ae343b14630 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -5850,6 +5850,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) int fof_vectors = 0; int extra; uint64_t wwn; + u32 if_type; + u32 if_fam; phba->sli4_hba.num_online_cpu = num_online_cpus(); phba->sli4_hba.num_present_cpu = lpfc_present_cpu; @@ -6171,15 +6173,28 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) */ rc = lpfc_get_sli4_parameters(phba, mboxq); if (rc) { + if_type = bf_get(lpfc_sli_intf_if_type, + &phba->sli4_hba.sli_intf); + if_fam = bf_get(lpfc_sli_intf_sli_family, + &phba->sli4_hba.sli_intf); if (phba->sli4_hba.extents_in_use && phba->sli4_hba.rpi_hdrs_in_use) { lpfc_printf_log(phba, KERN_ERR, LOG_INIT, "2999 Unsupported SLI4 Parameters " "Extents and RPI headers enabled.\n"); + if (if_type == LPFC_SLI_INTF_IF_TYPE_0 && + if_fam == LPFC_SLI_INTF_FAMILY_BE2) { + mempool_free(mboxq, phba->mbox_mem_pool); + rc = -EIO; + goto out_free_bsmbx; + } + } + if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 && + if_fam == LPFC_SLI_INTF_FAMILY_BE2)) { + mempool_free(mboxq, phba->mbox_mem_pool); + rc = -EIO; + goto out_free_bsmbx; } - mempool_free(mboxq, phba->mbox_mem_pool); - rc = -EIO; - goto out_free_bsmbx; } mempool_free(mboxq, phba->mbox_mem_pool);