aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_init.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2013-04-17 20:14:38 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 15:37:45 -0400
commit16a3a20842f3df93f4ccb82b8f374be16280a337 (patch)
tree6291b5e85a7cac6b0d888dca3ed2a49ef5984de2 /drivers/scsi/lpfc/lpfc_init.c
parent96b04db9f2c16e77c31ef0e17e143da1e0cbfd78 (diff)
[SCSI] lpfc 8.3.39: Fixed VPI allocation issues after firmware dump is performed
Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 5da297290262..8edef6c4d57a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -2633,6 +2633,7 @@ lpfc_online(struct lpfc_hba *phba)
2633 struct lpfc_vport *vport; 2633 struct lpfc_vport *vport;
2634 struct lpfc_vport **vports; 2634 struct lpfc_vport **vports;
2635 int i; 2635 int i;
2636 bool vpis_cleared = false;
2636 2637
2637 if (!phba) 2638 if (!phba)
2638 return 0; 2639 return 0;
@@ -2656,6 +2657,10 @@ lpfc_online(struct lpfc_hba *phba)
2656 lpfc_unblock_mgmt_io(phba); 2657 lpfc_unblock_mgmt_io(phba);
2657 return 1; 2658 return 1;
2658 } 2659 }
2660 spin_lock_irq(&phba->hbalock);
2661 if (!phba->sli4_hba.max_cfg_param.vpi_used)
2662 vpis_cleared = true;
2663 spin_unlock_irq(&phba->hbalock);
2659 } else { 2664 } else {
2660 if (lpfc_sli_hba_setup(phba)) { /* Initialize SLI2/SLI3 HBA */ 2665 if (lpfc_sli_hba_setup(phba)) { /* Initialize SLI2/SLI3 HBA */
2661 lpfc_unblock_mgmt_io(phba); 2666 lpfc_unblock_mgmt_io(phba);
@@ -2672,8 +2677,13 @@ lpfc_online(struct lpfc_hba *phba)
2672 vports[i]->fc_flag &= ~FC_OFFLINE_MODE; 2677 vports[i]->fc_flag &= ~FC_OFFLINE_MODE;
2673 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) 2678 if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED)
2674 vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI; 2679 vports[i]->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
2675 if (phba->sli_rev == LPFC_SLI_REV4) 2680 if (phba->sli_rev == LPFC_SLI_REV4) {
2676 vports[i]->fc_flag |= FC_VPORT_NEEDS_INIT_VPI; 2681 vports[i]->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
2682 if ((vpis_cleared) &&
2683 (vports[i]->port_type !=
2684 LPFC_PHYSICAL_PORT))
2685 vports[i]->vpi = 0;
2686 }
2677 spin_unlock_irq(shost->host_lock); 2687 spin_unlock_irq(shost->host_lock);
2678 } 2688 }
2679 lpfc_destroy_vport_work_array(phba, vports); 2689 lpfc_destroy_vport_work_array(phba, vports);