From patchwork Wed Aug 2 23:36:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Smart X-Patchwork-Id: 9877943 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 05CA460360 for ; Wed, 2 Aug 2017 23:38:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC6C02878E for ; Wed, 2 Aug 2017 23:38:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1A5328842; Wed, 2 Aug 2017 23:38:21 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 96F432878E for ; Wed, 2 Aug 2017 23:38:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbdHBXiS (ORCPT ); Wed, 2 Aug 2017 19:38:18 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34543 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbdHBXiQ (ORCPT ); Wed, 2 Aug 2017 19:38:16 -0400 Received: by mail-qk0-f194.google.com with SMTP id q66so6121513qki.1 for ; Wed, 02 Aug 2017 16:38:16 -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=YpQep++s+NXcZe9VS6/ja2cmrqK8m9MIcs9Z+pyHFuM=; b=ChKfzqwUhKl8tq7wC8KGX3V3PNeuQDBYE8I1LMv5WtaBN6mHyJ6sO5QzVGYgsx1Jnw 2C8AqJu4jsKyD8pIej7L6rdHjBDW4mdYNwrgjd43GXyYbm/G9ZC/NjOoyqQaVGGUtWX6 lZTLi29jfOsXFAX92NL9ZKLiaBrbIFb3ReNGg9mYhhm/gYe6dJKsllPj1g1lG0y8fonO sdF6zZRkCC8Z63mY0O58A8km7Az0ypXIAfAXQM7z3IsdnbWjKAqwKX8HLpoYQrA4NRfp Y71BiHc3ptrb7tqfHlxJyQ45LtHigwJv8OYudORzz2Je2T7qXr8T35kL772hGOOB/ruu ECuQ== 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=YpQep++s+NXcZe9VS6/ja2cmrqK8m9MIcs9Z+pyHFuM=; b=BfKJKURCyKkJhdffTOvXOVcphCP9IDjuviZgqZ7AXUikO0H0PemcVRTznkll1ya8Yy bbiyqfNVCyNTat3T7OX6WV5UDFJht/jE+vnl9yfOQ2FHKpOQeBlVGFRnKdHEGnqNaw/r hK7TF8RHoS0bKGrr6TtaPvIyaNGV6rJfeEB/kJ+g1vnZjFhjknr6RKnjF8eUvLIvne81 a587oSHysiBeYd2QI3oLAIarJbFxBXBZcFMrFBqfKx2WftQd8+9GDQ13vm6I89y8nspr BJyF4Rx/ZlLmW9a1ubKVpxLLY9h47Rga/3P+vB2ZXJ0HwAw3gJPoDVyA5p2j2svDfEg1 GVXw== X-Gm-Message-State: AHYfb5gRsVcomEcB4H0Etqb3mu/ovF/nCz5n8mlTU4quq5hmZRCjyoNC WKUML6m492Rue9w9 X-Received: by 10.55.22.199 with SMTP id 68mr31001qkw.218.1501717095586; Wed, 02 Aug 2017 16:38:15 -0700 (PDT) Received: from pallmd1.broadcom.com ([192.19.255.250]) by smtp.gmail.com with ESMTPSA id c55sm26260318qta.8.2017.08.02.16.38.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 02 Aug 2017 16:38:14 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: Dick Kennedy , James Smart Subject: [PATCH 16/21] lpfc: Fix nvme target failure after 2nd adapter reset Date: Wed, 2 Aug 2017 16:36:43 -0700 Message-Id: <20170802233648.4573-17-jsmart2021@gmail.com> X-Mailer: git-send-email 2.13.1 In-Reply-To: <20170802233648.4573-1-jsmart2021@gmail.com> References: <20170802233648.4573-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 From: Dick Kennedy Fix nvme target failure after 2nd adapter reset The nonrecovery occurred because the lpfc nvme initiator function did not reestablish its localport creation with the nvme host transport in lpfc_oneline. Because of that, an NVME rport binding could not take place. Corrected by recreating the localport in the adapter reset recovery routine. Signed-off-by: Dick Kennedy Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_init.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 897eb62ed4e6..659662777b65 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3048,7 +3048,7 @@ lpfc_online(struct lpfc_hba *phba) { struct lpfc_vport *vport; struct lpfc_vport **vports; - int i; + int i, error = 0; bool vpis_cleared = false; if (!phba) @@ -3072,6 +3072,22 @@ lpfc_online(struct lpfc_hba *phba) if (!phba->sli4_hba.max_cfg_param.vpi_used) vpis_cleared = true; spin_unlock_irq(&phba->hbalock); + + /* Reestablish the local initiator port. + * The offline process destroyed the previous lport. + */ + if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) { + if (!phba->nvmet_support) { + error = lpfc_nvme_create_localport(phba->pport); + if (error) { + lpfc_printf_log(phba, KERN_ERR, + LOG_INIT, + "6132 NVME restore reg " + "failed on nvmei error " + "x%x\n", error); + } + } + } } else { lpfc_sli_queue_init(phba); if (lpfc_sli_hba_setup(phba)) { /* Initialize SLI2/SLI3 HBA */