aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_els.c
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2012-05-09 21:16:42 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-05-17 05:32:47 -0400
commite64464391d39b69c950d3645f001eb1af7a8bfd0 (patch)
tree661757d92fa786b14b86c1f4dea18bb71e4b00cb /drivers/scsi/lpfc/lpfc_els.c
parentb99570dd63757834cd0c21e1b117c857af90a04a (diff)
[SCSI] lpfc 8.3.31: Fix initiator sending flogi after acking flogi from target
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com> Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_els.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_els.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c
index 3407b39e0a3f..c89c5c239e7e 100644
--- a/drivers/scsi/lpfc/lpfc_els.c
+++ b/drivers/scsi/lpfc/lpfc_els.c
@@ -3803,10 +3803,11 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag,
3803 /* Xmit ELS ACC response tag <ulpIoTag> */ 3803 /* Xmit ELS ACC response tag <ulpIoTag> */
3804 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, 3804 lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS,
3805 "0128 Xmit ELS ACC response tag x%x, XRI: x%x, " 3805 "0128 Xmit ELS ACC response tag x%x, XRI: x%x, "
3806 "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x\n", 3806 "DID: x%x, nlp_flag: x%x nlp_state: x%x RPI: x%x "
3807 "fc_flag x%x\n",
3807 elsiocb->iotag, elsiocb->iocb.ulpContext, 3808 elsiocb->iotag, elsiocb->iocb.ulpContext,
3808 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, 3809 ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state,
3809 ndlp->nlp_rpi); 3810 ndlp->nlp_rpi, vport->fc_flag);
3810 if (ndlp->nlp_flag & NLP_LOGO_ACC) { 3811 if (ndlp->nlp_flag & NLP_LOGO_ACC) {
3811 spin_lock_irq(shost->host_lock); 3812 spin_lock_irq(shost->host_lock);
3812 ndlp->nlp_flag &= ~NLP_LOGO_ACC; 3813 ndlp->nlp_flag &= ~NLP_LOGO_ACC;
@@ -4976,7 +4977,10 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
4976 spin_lock_irq(shost->host_lock); 4977 spin_lock_irq(shost->host_lock);
4977 vport->fc_flag |= FC_PT2PT_PLOGI; 4978 vport->fc_flag |= FC_PT2PT_PLOGI;
4978 spin_unlock_irq(shost->host_lock); 4979 spin_unlock_irq(shost->host_lock);
4979 } 4980 vport->fc_myDID = PT2PT_LocalID;
4981 } else
4982 vport->fc_myDID = PT2PT_RemoteID;
4983 vport->port_state = LPFC_FLOGI;
4980 spin_lock_irq(shost->host_lock); 4984 spin_lock_irq(shost->host_lock);
4981 vport->fc_flag |= FC_PT2PT; 4985 vport->fc_flag |= FC_PT2PT;
4982 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP); 4986 vport->fc_flag &= ~(FC_FABRIC | FC_PUBLIC_LOOP);
@@ -4995,7 +4999,25 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb,
4995 /* Send back ACC */ 4999 /* Send back ACC */
4996 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL); 5000 lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, ndlp, NULL);
4997 5001
5002 if (!(vport->fc_flag & FC_PT2PT_PLOGI)) {
5003 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL);
5004 if (!mbox)
5005 goto fail;
5006
5007 lpfc_config_link(phba, mbox);
5008
5009 mbox->mbox_cmpl = lpfc_sli_def_mbox_cmpl;
5010 mbox->vport = vport;
5011 rc = lpfc_sli_issue_mbox(phba, mbox, MBX_NOWAIT);
5012 if (rc == MBX_NOT_FINISHED) {
5013 mempool_free(mbox, phba->mbox_mem_pool);
5014 goto fail;
5015 }
5016 }
5017
4998 return 0; 5018 return 0;
5019fail:
5020 return 1;
4999} 5021}
5000 5022
5001/** 5023/**