aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index 62deb31fa4b8..3081db730b44 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1436,7 +1436,8 @@ lpfc_register_fcf(struct lpfc_hba *phba)
1436 if (phba->fcf.fcf_flag & FCF_REGISTERED) { 1436 if (phba->fcf.fcf_flag & FCF_REGISTERED) {
1437 phba->fcf.fcf_flag |= (FCF_SCAN_DONE | FCF_IN_USE); 1437 phba->fcf.fcf_flag |= (FCF_SCAN_DONE | FCF_IN_USE);
1438 phba->hba_flag &= ~FCF_TS_INPROG; 1438 phba->hba_flag &= ~FCF_TS_INPROG;
1439 if (phba->pport->port_state != LPFC_FLOGI) { 1439 if (phba->pport->port_state != LPFC_FLOGI &&
1440 phba->pport->fc_flag & FC_FABRIC) {
1440 phba->hba_flag |= FCF_RR_INPROG; 1441 phba->hba_flag |= FCF_RR_INPROG;
1441 spin_unlock_irq(&phba->hbalock); 1442 spin_unlock_irq(&phba->hbalock);
1442 lpfc_initial_flogi(phba->pport); 1443 lpfc_initial_flogi(phba->pport);
@@ -2906,9 +2907,14 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
2906 goto out_free_mem; 2907 goto out_free_mem;
2907 } 2908 }
2908 2909
2909 /* If the VFI is already registered, there is nothing else to do */ 2910 /* If the VFI is already registered, there is nothing else to do
2911 * Unless this was a VFI update and we are in PT2PT mode, then
2912 * we should drop through to set the port state to ready.
2913 */
2910 if (vport->fc_flag & FC_VFI_REGISTERED) 2914 if (vport->fc_flag & FC_VFI_REGISTERED)
2911 goto out_free_mem; 2915 if (!(phba->sli_rev == LPFC_SLI_REV4 &&
2916 vport->fc_flag & FC_PT2PT))
2917 goto out_free_mem;
2912 2918
2913 /* The VPI is implicitly registered when the VFI is registered */ 2919 /* The VPI is implicitly registered when the VFI is registered */
2914 spin_lock_irq(shost->host_lock); 2920 spin_lock_irq(shost->host_lock);
@@ -2925,6 +2931,13 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
2925 goto out_free_mem; 2931 goto out_free_mem;
2926 } 2932 }
2927 2933
2934 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
2935 "3313 cmpl reg vfi port_state:%x fc_flag:%x myDid:%x "
2936 "alpacnt:%d LinkState:%x topology:%x\n",
2937 vport->port_state, vport->fc_flag, vport->fc_myDID,
2938 vport->phba->alpa_map[0],
2939 phba->link_state, phba->fc_topology);
2940
2928 if (vport->port_state == LPFC_FABRIC_CFG_LINK) { 2941 if (vport->port_state == LPFC_FABRIC_CFG_LINK) {
2929 /* 2942 /*
2930 * For private loop or for NPort pt2pt, 2943 * For private loop or for NPort pt2pt,
@@ -2937,7 +2950,10 @@ lpfc_mbx_cmpl_reg_vfi(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
2937 /* Use loop map to make discovery list */ 2950 /* Use loop map to make discovery list */
2938 lpfc_disc_list_loopmap(vport); 2951 lpfc_disc_list_loopmap(vport);
2939 /* Start discovery */ 2952 /* Start discovery */
2940 lpfc_disc_start(vport); 2953 if (vport->fc_flag & FC_PT2PT)
2954 vport->port_state = LPFC_VPORT_READY;
2955 else
2956 lpfc_disc_start(vport);
2941 } else { 2957 } else {
2942 lpfc_start_fdiscs(phba); 2958 lpfc_start_fdiscs(phba);
2943 lpfc_do_scr_ns_plogi(phba, vport); 2959 lpfc_do_scr_ns_plogi(phba, vport);
@@ -3019,6 +3035,15 @@ lpfc_mbx_process_link_up(struct lpfc_hba *phba, struct lpfc_mbx_read_top *la)
3019 break; 3035 break;
3020 } 3036 }
3021 3037
3038 if (phba->fc_topology &&
3039 phba->fc_topology != bf_get(lpfc_mbx_read_top_topology, la)) {
3040 lpfc_printf_log(phba, KERN_WARNING, LOG_SLI,
3041 "3314 Toplogy changed was 0x%x is 0x%x\n",
3042 phba->fc_topology,
3043 bf_get(lpfc_mbx_read_top_topology, la));
3044 phba->fc_topology_changed = 1;
3045 }
3046
3022 phba->fc_topology = bf_get(lpfc_mbx_read_top_topology, la); 3047 phba->fc_topology = bf_get(lpfc_mbx_read_top_topology, la);
3023 phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED; 3048 phba->link_flag &= ~LS_NPIV_FAB_SUPPORTED;
3024 3049
@@ -4961,8 +4986,12 @@ lpfc_disc_start(struct lpfc_vport *vport)
4961 uint32_t clear_la_pending; 4986 uint32_t clear_la_pending;
4962 int did_changed; 4987 int did_changed;
4963 4988
4964 if (!lpfc_is_link_up(phba)) 4989 if (!lpfc_is_link_up(phba)) {
4990 lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI,
4991 "3315 Link is not up %x\n",
4992 phba->link_state);
4965 return; 4993 return;
4994 }
4966 4995
4967 if (phba->link_state == LPFC_CLEAR_LA) 4996 if (phba->link_state == LPFC_CLEAR_LA)
4968 clear_la_pending = 1; 4997 clear_la_pending = 1;
@@ -5868,7 +5897,7 @@ lpfc_unregister_fcf_prep(struct lpfc_hba *phba)
5868 struct lpfc_vport **vports; 5897 struct lpfc_vport **vports;
5869 struct lpfc_nodelist *ndlp; 5898 struct lpfc_nodelist *ndlp;
5870 struct Scsi_Host *shost; 5899 struct Scsi_Host *shost;
5871 int i, rc; 5900 int i = 0, rc;
5872 5901
5873 /* Unregister RPIs */ 5902 /* Unregister RPIs */
5874 if (lpfc_fcf_inuse(phba)) 5903 if (lpfc_fcf_inuse(phba))
@@ -5896,6 +5925,20 @@ lpfc_unregister_fcf_prep(struct lpfc_hba *phba)
5896 spin_unlock_irq(shost->host_lock); 5925 spin_unlock_irq(shost->host_lock);
5897 } 5926 }
5898 lpfc_destroy_vport_work_array(phba, vports); 5927 lpfc_destroy_vport_work_array(phba, vports);
5928 if (i == 0 && (!(phba->sli3_options & LPFC_SLI3_NPIV_ENABLED))) {
5929 ndlp = lpfc_findnode_did(phba->pport, Fabric_DID);
5930 if (ndlp)
5931 lpfc_cancel_retry_delay_tmo(phba->pport, ndlp);
5932 lpfc_cleanup_pending_mbox(phba->pport);
5933 if (phba->sli_rev == LPFC_SLI_REV4)
5934 lpfc_sli4_unreg_all_rpis(phba->pport);
5935 lpfc_mbx_unreg_vpi(phba->pport);
5936 shost = lpfc_shost_from_vport(phba->pport);
5937 spin_lock_irq(shost->host_lock);
5938 phba->pport->fc_flag |= FC_VPORT_NEEDS_INIT_VPI;
5939 phba->pport->vpi_state &= ~LPFC_VPI_REGISTERED;
5940 spin_unlock_irq(shost->host_lock);
5941 }
5899 5942
5900 /* Cleanup any outstanding ELS commands */ 5943 /* Cleanup any outstanding ELS commands */
5901 lpfc_els_flush_all_cmd(phba); 5944 lpfc_els_flush_all_cmd(phba);