@@ -682,7 +682,6 @@ int qla24xx_async_notify_ack(scsi_qla_host_t *vha, fc_port_t *fcport,
682
682
void qla24xx_do_nack_work (struct scsi_qla_host * vha , struct qla_work_evt * e )
683
683
{
684
684
fc_port_t * t ;
685
- unsigned long flags ;
686
685
687
686
switch (e -> u .nack .type ) {
688
687
case SRB_NACK_PRLI :
@@ -695,10 +694,8 @@ void qla24xx_do_nack_work(struct scsi_qla_host *vha, struct qla_work_evt *e)
695
694
if (t ) {
696
695
ql_log (ql_log_info , vha , 0xd034 ,
697
696
"%s create sess success %p" , __func__ , t );
698
- spin_lock_irqsave (& vha -> hw -> tgt .sess_lock , flags );
699
697
/* create sess has an extra kref */
700
698
vha -> hw -> tgt .tgt_ops -> put_sess (e -> u .nack .fcport );
701
- spin_unlock_irqrestore (& vha -> hw -> tgt .sess_lock , flags );
702
699
}
703
700
break ;
704
701
}
@@ -710,17 +707,13 @@ void qla24xx_delete_sess_fn(struct work_struct *work)
710
707
{
711
708
fc_port_t * fcport = container_of (work , struct fc_port , del_work );
712
709
struct qla_hw_data * ha = fcport -> vha -> hw ;
713
- unsigned long flags ;
714
-
715
- spin_lock_irqsave (& ha -> tgt .sess_lock , flags );
716
710
717
711
if (fcport -> se_sess ) {
718
712
ha -> tgt .tgt_ops -> shutdown_sess (fcport );
719
713
ha -> tgt .tgt_ops -> put_sess (fcport );
720
714
} else {
721
715
qlt_unreg_sess (fcport );
722
716
}
723
- spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
724
717
}
725
718
726
719
/*
@@ -789,8 +782,9 @@ void qlt_fc_port_added(struct scsi_qla_host *vha, fc_port_t *fcport)
789
782
fcport -> port_name , sess -> loop_id );
790
783
sess -> local = 0 ;
791
784
}
792
- ha -> tgt .tgt_ops -> put_sess (sess );
793
785
spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
786
+
787
+ ha -> tgt .tgt_ops -> put_sess (sess );
794
788
}
795
789
796
790
/*
@@ -4175,9 +4169,7 @@ static void __qlt_do_work(struct qla_tgt_cmd *cmd)
4175
4169
/*
4176
4170
* Drop extra session reference from qlt_handle_cmd_for_atio().
4177
4171
*/
4178
- spin_lock_irqsave (& ha -> tgt .sess_lock , flags );
4179
4172
ha -> tgt .tgt_ops -> put_sess (sess );
4180
- spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
4181
4173
return ;
4182
4174
4183
4175
out_term :
@@ -4194,9 +4186,7 @@ static void __qlt_do_work(struct qla_tgt_cmd *cmd)
4194
4186
target_free_tag (sess -> se_sess , & cmd -> se_cmd );
4195
4187
spin_unlock_irqrestore (qpair -> qp_lock_ptr , flags );
4196
4188
4197
- spin_lock_irqsave (& ha -> tgt .sess_lock , flags );
4198
4189
ha -> tgt .tgt_ops -> put_sess (sess );
4199
- spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
4200
4190
}
4201
4191
4202
4192
static void qlt_do_work (struct work_struct * work )
@@ -4405,9 +4395,7 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha,
4405
4395
if (!cmd ) {
4406
4396
ql_dbg (ql_dbg_io , vha , 0x3062 ,
4407
4397
"qla_target(%d): Allocation of cmd failed\n" , vha -> vp_idx );
4408
- spin_lock_irqsave (& ha -> tgt .sess_lock , flags );
4409
4398
ha -> tgt .tgt_ops -> put_sess (sess );
4410
- spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
4411
4399
return - EBUSY ;
4412
4400
}
4413
4401
@@ -6258,17 +6246,19 @@ static void qlt_abort_work(struct qla_tgt *tgt,
6258
6246
}
6259
6247
6260
6248
rc = __qlt_24xx_handle_abts (vha , & prm -> abts , sess );
6261
- ha -> tgt .tgt_ops -> put_sess (sess );
6262
6249
spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags2 );
6263
6250
6251
+ ha -> tgt .tgt_ops -> put_sess (sess );
6252
+
6264
6253
if (rc != 0 )
6265
6254
goto out_term ;
6266
6255
return ;
6267
6256
6268
6257
out_term2 :
6258
+ spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags2 );
6259
+
6269
6260
if (sess )
6270
6261
ha -> tgt .tgt_ops -> put_sess (sess );
6271
- spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags2 );
6272
6262
6273
6263
out_term :
6274
6264
spin_lock_irqsave (& ha -> hardware_lock , flags );
@@ -6326,9 +6316,10 @@ static void qlt_tmr_work(struct qla_tgt *tgt,
6326
6316
scsilun_to_int ((struct scsi_lun * )& a -> u .isp24 .fcp_cmnd .lun );
6327
6317
6328
6318
rc = qlt_issue_task_mgmt (sess , unpacked_lun , fn , iocb , 0 );
6329
- ha -> tgt .tgt_ops -> put_sess (sess );
6330
6319
spin_unlock_irqrestore (& ha -> tgt .sess_lock , flags );
6331
6320
6321
+ ha -> tgt .tgt_ops -> put_sess (sess );
6322
+
6332
6323
if (rc != 0 )
6333
6324
goto out_term ;
6334
6325
return ;
0 commit comments