aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c44
1 files changed, 33 insertions, 11 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 2ebf4e4e0234..1e3169e3ccbf 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -219,9 +219,9 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,
219 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) || 219 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) ||
220 fcport->loop_id == FC_NO_LOOP_ID) { 220 fcport->loop_id == FC_NO_LOOP_ID) {
221 ql_log(ql_log_warn, vha, 0xffff, 221 ql_log(ql_log_warn, vha, 0xffff,
222 "%s: %8phC - not sending command.\n", 222 "%s: %8phC online %d flags %x - not sending command.\n",
223 __func__, fcport->port_name); 223 __func__, fcport->port_name, vha->flags.online, fcport->flags);
224 return rval; 224 goto done;
225 } 225 }
226 226
227 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL); 227 sp = qla2x00_get_sp(vha, fcport, GFP_KERNEL);
@@ -797,8 +797,6 @@ qla24xx_async_gnl_sp_done(void *s, int res)
797 sp->name, res, sp->u.iocb_cmd.u.mbx.in_mb[1], 797 sp->name, res, sp->u.iocb_cmd.u.mbx.in_mb[1],
798 sp->u.iocb_cmd.u.mbx.in_mb[2]); 798 sp->u.iocb_cmd.u.mbx.in_mb[2]);
799 799
800 if (res == QLA_FUNCTION_TIMEOUT)
801 return;
802 800
803 sp->fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE); 801 sp->fcport->flags &= ~(FCF_ASYNC_SENT|FCF_ASYNC_ACTIVE);
804 memset(&ea, 0, sizeof(ea)); 802 memset(&ea, 0, sizeof(ea));
@@ -837,8 +835,8 @@ qla24xx_async_gnl_sp_done(void *s, int res)
837 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 835 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
838 836
839 list_for_each_entry_safe(fcport, tf, &h, gnl_entry) { 837 list_for_each_entry_safe(fcport, tf, &h, gnl_entry) {
840 list_del_init(&fcport->gnl_entry);
841 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags); 838 spin_lock_irqsave(&vha->hw->tgt.sess_lock, flags);
839 list_del_init(&fcport->gnl_entry);
842 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE); 840 fcport->flags &= ~(FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE);
843 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags); 841 spin_unlock_irqrestore(&vha->hw->tgt.sess_lock, flags);
844 ea.fcport = fcport; 842 ea.fcport = fcport;
@@ -893,6 +891,14 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport)
893 unsigned long flags; 891 unsigned long flags;
894 u16 *mb; 892 u16 *mb;
895 893
894 if (IS_SESSION_DELETED(fcport)) {
895 ql_log(ql_log_warn, vha, 0xffff,
896 "%s: %8phC is being delete - not sending command.\n",
897 __func__, fcport->port_name);
898 fcport->flags &= ~FCF_ASYNC_ACTIVE;
899 return rval;
900 }
901
896 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT)) 902 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT))
897 return rval; 903 return rval;
898 904
@@ -1123,8 +1129,15 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
1123 struct port_database_24xx *pd; 1129 struct port_database_24xx *pd;
1124 struct qla_hw_data *ha = vha->hw; 1130 struct qla_hw_data *ha = vha->hw;
1125 1131
1126 if (!vha->flags.online || (fcport->flags & FCF_ASYNC_SENT) || 1132 if (IS_SESSION_DELETED(fcport)) {
1127 fcport->loop_id == FC_NO_LOOP_ID) { 1133 ql_log(ql_log_warn, vha, 0xffff,
1134 "%s: %8phC is being delete - not sending command.\n",
1135 __func__, fcport->port_name);
1136 fcport->flags &= ~FCF_ASYNC_ACTIVE;
1137 return rval;
1138 }
1139
1140 if (!vha->flags.online || fcport->flags & FCF_ASYNC_SENT) {
1128 ql_log(ql_log_warn, vha, 0xffff, 1141 ql_log(ql_log_warn, vha, 0xffff,
1129 "%s: %8phC - not sending command.\n", 1142 "%s: %8phC - not sending command.\n",
1130 __func__, fcport->port_name); 1143 __func__, fcport->port_name);
@@ -1333,7 +1346,8 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
1333 fcport->login_gen, fcport->login_retry, 1346 fcport->login_gen, fcport->login_retry,
1334 fcport->loop_id, fcport->scan_state); 1347 fcport->loop_id, fcport->scan_state);
1335 1348
1336 if (fcport->scan_state != QLA_FCPORT_FOUND) 1349 if (fcport->scan_state != QLA_FCPORT_FOUND ||
1350 fcport->disc_state == DSC_DELETE_PEND)
1337 return 0; 1351 return 0;
1338 1352
1339 if ((fcport->loop_id != FC_NO_LOOP_ID) && 1353 if ((fcport->loop_id != FC_NO_LOOP_ID) &&
@@ -1352,7 +1366,7 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)
1352 if (vha->host->active_mode == MODE_TARGET) 1366 if (vha->host->active_mode == MODE_TARGET)
1353 return 0; 1367 return 0;
1354 1368
1355 if (fcport->flags & FCF_ASYNC_SENT) { 1369 if (fcport->flags & (FCF_ASYNC_SENT | FCF_ASYNC_ACTIVE)) {
1356 set_bit(RELOGIN_NEEDED, &vha->dpc_flags); 1370 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
1357 return 0; 1371 return 0;
1358 } 1372 }
@@ -3153,6 +3167,14 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
3153 struct rsp_que *rsp = ha->rsp_q_map[0]; 3167 struct rsp_que *rsp = ha->rsp_q_map[0];
3154 struct qla2xxx_fw_dump *fw_dump; 3168 struct qla2xxx_fw_dump *fw_dump;
3155 3169
3170 if (ha->fw_dump) {
3171 ql_dbg(ql_dbg_init, vha, 0x00bd,
3172 "Firmware dump already allocated.\n");
3173 return;
3174 }
3175
3176 ha->fw_dumped = 0;
3177 ha->fw_dump_cap_flags = 0;
3156 dump_size = fixed_size = mem_size = eft_size = fce_size = mq_size = 0; 3178 dump_size = fixed_size = mem_size = eft_size = fce_size = mq_size = 0;
3157 req_q_size = rsp_q_size = 0; 3179 req_q_size = rsp_q_size = 0;
3158 3180
@@ -8711,7 +8733,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
8711 qpair->rsp->req = qpair->req; 8733 qpair->rsp->req = qpair->req;
8712 qpair->rsp->qpair = qpair; 8734 qpair->rsp->qpair = qpair;
8713 /* init qpair to this cpu. Will adjust at run time. */ 8735 /* init qpair to this cpu. Will adjust at run time. */
8714 qla_cpu_update(qpair, smp_processor_id()); 8736 qla_cpu_update(qpair, raw_smp_processor_id());
8715 8737
8716 if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) { 8738 if (IS_T10_PI_CAPABLE(ha) && ql2xenabledif) {
8717 if (ha->fw_attributes & BIT_4) 8739 if (ha->fw_attributes & BIT_4)