Commit 82abdcaf authored by Quinn Tran's avatar Quinn Tran Committed by Martin K. Petersen

scsi: qla2xxx: Allow target mode to accept PRLI in dual mode

For Dual Mode, Initiator side of the driver finish login,
target side receive PRLI, but driver terminates PRLI.
This patch allows target side to go ahead and accept PRLI.
Signed-off-by: default avatarQuinn Tran <quinn.tran@cavium.com>
Signed-off-by: default avatarHimanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 045d6ea2
...@@ -1537,6 +1537,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ...@@ -1537,6 +1537,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
port_id_t cid; /* conflict Nport id */ port_id_t cid; /* conflict Nport id */
u16 lid; u16 lid;
struct fc_port *conflict_fcport; struct fc_port *conflict_fcport;
unsigned long flags;
switch (ea->data[0]) { switch (ea->data[0]) {
case MBS_COMMAND_COMPLETE: case MBS_COMMAND_COMPLETE:
...@@ -1557,10 +1558,14 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) ...@@ -1557,10 +1558,14 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea)
ea->fcport->loop_id, ea->fcport->d_id.b24); ea->fcport->loop_id, ea->fcport->d_id.b24);
set_bit(ea->fcport->loop_id, vha->hw->loop_id_map); set_bit(ea->fcport->loop_id, vha->hw->loop_id_map);
spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
ea->fcport->loop_id = FC_NO_LOOP_ID; ea->fcport->loop_id = FC_NO_LOOP_ID;
ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset; ea->fcport->chip_reset = vha->hw->base_qpair->chip_reset;
ea->fcport->logout_on_delete = 1; ea->fcport->logout_on_delete = 1;
ea->fcport->send_els_logo = 0; ea->fcport->send_els_logo = 0;
ea->fcport->fw_login_state = DSC_LS_PRLI_COMP;
spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
qla24xx_post_gpdb_work(vha, ea->fcport, 0); qla24xx_post_gpdb_work(vha, ea->fcport, 0);
} }
break; break;
......
...@@ -4682,7 +4682,7 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, ...@@ -4682,7 +4682,7 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
uint16_t wd3_lo; uint16_t wd3_lo;
int res = 0; int res = 0;
struct qlt_plogi_ack_t *pla; struct qlt_plogi_ack_t *pla;
unsigned long flags; unsigned long flags = 0;
wwn = wwn_to_u64(iocb->u.isp24.port_name); wwn = wwn_to_u64(iocb->u.isp24.port_name);
...@@ -4818,8 +4818,14 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, ...@@ -4818,8 +4818,14 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
} }
if (sess != NULL) { if (sess != NULL) {
if (sess->fw_login_state != DSC_LS_PLOGI_PEND && spin_lock_irqsave(&tgt->ha->tgt.sess_lock, flags);
sess->fw_login_state != DSC_LS_PLOGI_COMP) { switch (sess->fw_login_state) {
case DSC_LS_PLOGI_COMP:
case DSC_LS_PRLI_COMP:
break;
default:
spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock,
flags);
/* /*
* Impatient initiator sent PRLI before last * Impatient initiator sent PRLI before last
* PLOGI could finish. Will force him to re-try, * PLOGI could finish. Will force him to re-try,
...@@ -4830,6 +4836,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, ...@@ -4830,6 +4836,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
sess); sess);
qlt_send_term_imm_notif(vha, iocb, 1); qlt_send_term_imm_notif(vha, iocb, 1);
res = 0; res = 0;
spin_lock_irqsave(&tgt->ha->tgt.sess_lock,
flags);
break; break;
} }
...@@ -4853,6 +4861,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha, ...@@ -4853,6 +4861,8 @@ static int qlt_24xx_handle_els(struct scsi_qla_host *vha,
sess->port_type = FCT_INITIATOR; sess->port_type = FCT_INITIATOR;
else else
sess->port_type = FCT_TARGET; sess->port_type = FCT_TARGET;
spin_unlock_irqrestore(&tgt->ha->tgt.sess_lock, flags);
} }
res = 1; /* send notify ack */ res = 1; /* send notify ack */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment