From patchwork Fri Jun 16 05:56: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: 9790579 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 5FE8360231 for ; Fri, 16 Jun 2017 05:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CED92861F for ; Fri, 16 Jun 2017 05:57:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41D3D28641; Fri, 16 Jun 2017 05:57:09 +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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 CD5522861F for ; Fri, 16 Jun 2017 05:57:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752077AbdFPF5I (ORCPT ); Fri, 16 Jun 2017 01:57:08 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:35288 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752068AbdFPF5H (ORCPT ); Fri, 16 Jun 2017 01:57:07 -0400 Received: by mail-qt0-f196.google.com with SMTP id x58so7924827qtc.2 for ; Thu, 15 Jun 2017 22:57:07 -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=CIgjaE8nVIWkPvarLxWyeD2dzwEjfVZLL8EpLIHatjw=; b=HWqrwjimF16CsnehD5+Q8ZrrAG9lQiuGlThqwKg0OvwN84TV+Iu/6B1zZFgrQhkRMe lKuFH8GAZBwDK56SANvhq4gmC1Tn7Nmm4pRtCXEkDrWv1ZG+XzU3hho5sibgBgiEVoWn dN43vBnkabJ6wJalDbXbtRIbv3MW8qZqOxYSETJKWYSxykmW1RpRRDkW9sEb9xcyQWij NEdVDCE0dA/KFzchaWKZVXSxoe5oOVoJMMdexzXSjooY56fjbfEv+wHNy2MweP99W5uN M62VTCbOvYY+6HPVLjJNVYVSqjxuu4xBxE4w7gBUi1ZCWSU+gozQzDTquBnLAlOuN+jH TM0w== 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=CIgjaE8nVIWkPvarLxWyeD2dzwEjfVZLL8EpLIHatjw=; b=LgO1ZJu2pLfI1c7HUJVQ5VbZCGq9nwKRvA75BJW2/WTtfUENJsAeUBdeOz+w0PiW95 cXj5HbTyO6OtLij/GWlPgtrY84YJ3yM4Y95JH4AXzbRvmOAYCV4VuAJavadw2vuFRv6h pKetatX0v0khW7kize744b8XZ5pocSckHz8TTL7QsQRdSMyJP2oD41tHHYemiRWY8LXW Rei2KkbNv/GvTHHYG1leI/5Oh0GSBgAHWAPLG9nfRVGoZH8CpMlpIDo34c4q99WeNi6l b73mU6tsH3bAZtg5yzaLC5iKfjCeTBFNm0z7TF0PFzTmcZF88DhIh+uakA5cyAE8ladv avEg== X-Gm-Message-State: AKS2vOwcIt2AmU1CDt5QNce0FS5WDsq6hV5Om3Z+I514QFwliAkLe6FD f498sAFKXfDtcqwq X-Received: by 10.55.15.9 with SMTP id z9mr10455511qkg.195.1497592626242; Thu, 15 Jun 2017 22:57:06 -0700 (PDT) Received: from localhost.localdomain ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id d16sm925428qke.5.2017.06.15.22.57.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 22:57:05 -0700 (PDT) From: James Smart To: linux-scsi@vger.kernel.org Cc: James Smart , Dick Kennedy , James Smart Subject: [PATCH 03/11] Vport creation is failing with "Link Down" error Date: Thu, 15 Jun 2017 22:56:43 -0700 Message-Id: <20170616055651.9674-4-jsmart2021@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170616055651.9674-1-jsmart2021@gmail.com> References: <20170616055651.9674-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 Vport creation fails for SLI-3 adapters. Mailbox submission fails because mailbox interrupt is disabled. Mailbox interrupt is disabled during port reset. Do reset only for physical port. Signed-off-by: Dick Kennedy Signed-off-by: James Smart Reviewed-by: Hannes Reinecke --- drivers/scsi/lpfc/lpfc_init.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 9d3a12636455..77283705eb8d 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3691,14 +3691,6 @@ lpfc_get_wwpn(struct lpfc_hba *phba) LPFC_MBOXQ_t *mboxq; MAILBOX_t *mb; - if (phba->sli_rev < LPFC_SLI_REV4) { - /* Reset the port first */ - lpfc_sli_brdrestart(phba); - rc = lpfc_sli_chipset_init(phba); - if (rc) - return (uint64_t)-1; - } - mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); if (!mboxq) @@ -3852,8 +3844,19 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev) int i; uint64_t wwn; bool use_no_reset_hba = false; + int rc; - wwn = lpfc_get_wwpn(phba); + if (lpfc_no_hba_reset_cnt) { + if (phba->sli_rev < LPFC_SLI_REV4 && + dev == &phba->pcidev->dev) { + /* Reset the port first */ + lpfc_sli_brdrestart(phba); + rc = lpfc_sli_chipset_init(phba); + if (rc) + return NULL; + } + wwn = lpfc_get_wwpn(phba); + } for (i = 0; i < lpfc_no_hba_reset_cnt; i++) { if (wwn == lpfc_no_hba_reset[i]) {