]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
lpfc: Vport creation is failing with "Link
authorJames Smart <james.smart@broadcom.com>
Wed, 12 Jul 2017 22:52:28 +0000 (18:52 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Fri, 14 Jul 2017 00:14:23 +0000 (17:14 -0700)
[backport of f0b2223a666e93c84fd42a0c5dad8a17c08aa869]
From: rkennedy <dick.kennedy@avagotech.com>

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 <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/lpfc/lpfc_init.c

index db4bf113c2d0d0826a0a2c187c5a10ea9afcb70c..cb6d69846d98fc6c9556ad53bc1eebaee20d5d29 100644 (file)
@@ -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]) {