From: James Smart Date: Wed, 12 Jul 2017 22:52:28 +0000 (-0400) Subject: lpfc: Vport creation is failing with "Link X-Git-Tag: v4.1.12-106.0.20170720_1900~48 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=195abb48ed25be4cbbbbde6c49b20859260ed59e;p=users%2Fjedix%2Flinux-maple.git lpfc: Vport creation is failing with "Link [backport of f0b2223a666e93c84fd42a0c5dad8a17c08aa869] From: rkennedy Orabug: 26439257 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 Signed-off-by: Martin K. Petersen Signed-off-by: Brian Maly --- diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index db4bf113c2d0..cb6d69846d98 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -3357,14 +3357,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) @@ -3419,8 +3411,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]) {