diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_vport.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_vport.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 606efa767548..ffd575c379f3 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/kthread.h> | 27 | #include <linux/kthread.h> |
28 | #include <linux/pci.h> | 28 | #include <linux/pci.h> |
29 | #include <linux/slab.h> | ||
29 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
30 | 31 | ||
31 | #include <scsi/scsi.h> | 32 | #include <scsi/scsi.h> |
@@ -123,7 +124,12 @@ lpfc_vport_sparm(struct lpfc_hba *phba, struct lpfc_vport *vport) | |||
123 | } | 124 | } |
124 | mb = &pmb->u.mb; | 125 | mb = &pmb->u.mb; |
125 | 126 | ||
126 | lpfc_read_sparam(phba, pmb, vport->vpi); | 127 | rc = lpfc_read_sparam(phba, pmb, vport->vpi); |
128 | if (rc) { | ||
129 | mempool_free(pmb, phba->mbox_mem_pool); | ||
130 | return -ENOMEM; | ||
131 | } | ||
132 | |||
127 | /* | 133 | /* |
128 | * Grab buffer pointer and clear context1 so we can use | 134 | * Grab buffer pointer and clear context1 so we can use |
129 | * lpfc_sli_issue_box_wait | 135 | * lpfc_sli_issue_box_wait |
@@ -389,7 +395,7 @@ lpfc_vport_create(struct fc_vport *fc_vport, bool disable) | |||
389 | * by the port. | 395 | * by the port. |
390 | */ | 396 | */ |
391 | if ((phba->sli_rev == LPFC_SLI_REV4) && | 397 | if ((phba->sli_rev == LPFC_SLI_REV4) && |
392 | (pport->vfi_state & LPFC_VFI_REGISTERED)) { | 398 | (pport->fc_flag & FC_VFI_REGISTERED)) { |
393 | rc = lpfc_sli4_init_vpi(phba, vpi); | 399 | rc = lpfc_sli4_init_vpi(phba, vpi); |
394 | if (rc) { | 400 | if (rc) { |
395 | lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, | 401 | lpfc_printf_log(phba, KERN_ERR, LOG_VPORT, |
@@ -505,6 +511,7 @@ enable_vport(struct fc_vport *fc_vport) | |||
505 | struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; | 511 | struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; |
506 | struct lpfc_hba *phba = vport->phba; | 512 | struct lpfc_hba *phba = vport->phba; |
507 | struct lpfc_nodelist *ndlp = NULL; | 513 | struct lpfc_nodelist *ndlp = NULL; |
514 | struct Scsi_Host *shost = lpfc_shost_from_vport(vport); | ||
508 | 515 | ||
509 | if ((phba->link_state < LPFC_LINK_UP) || | 516 | if ((phba->link_state < LPFC_LINK_UP) || |
510 | (phba->fc_topology == TOPOLOGY_LOOP)) { | 517 | (phba->fc_topology == TOPOLOGY_LOOP)) { |
@@ -512,8 +519,10 @@ enable_vport(struct fc_vport *fc_vport) | |||
512 | return VPORT_OK; | 519 | return VPORT_OK; |
513 | } | 520 | } |
514 | 521 | ||
522 | spin_lock_irq(shost->host_lock); | ||
515 | vport->load_flag |= FC_LOADING; | 523 | vport->load_flag |= FC_LOADING; |
516 | vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; | 524 | vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; |
525 | spin_unlock_irq(shost->host_lock); | ||
517 | 526 | ||
518 | /* Use the Physical nodes Fabric NDLP to determine if the link is | 527 | /* Use the Physical nodes Fabric NDLP to determine if the link is |
519 | * up and ready to FDISC. | 528 | * up and ready to FDISC. |
@@ -700,6 +709,8 @@ lpfc_vport_delete(struct fc_vport *fc_vport) | |||
700 | } | 709 | } |
701 | spin_unlock_irq(&phba->ndlp_lock); | 710 | spin_unlock_irq(&phba->ndlp_lock); |
702 | } | 711 | } |
712 | if (!(vport->vpi_state & LPFC_VPI_REGISTERED)) | ||
713 | goto skip_logo; | ||
703 | vport->unreg_vpi_cmpl = VPORT_INVAL; | 714 | vport->unreg_vpi_cmpl = VPORT_INVAL; |
704 | timeout = msecs_to_jiffies(phba->fc_ratov * 2000); | 715 | timeout = msecs_to_jiffies(phba->fc_ratov * 2000); |
705 | if (!lpfc_issue_els_npiv_logo(vport, ndlp)) | 716 | if (!lpfc_issue_els_npiv_logo(vport, ndlp)) |