@@ -2223,6 +2223,8 @@ __qla2x00_async_tm_cmd(struct tmf_arg *arg)
22232223 rval = QLA_FUNCTION_FAILED ;
22242224 }
22252225 }
2226+ if (tm_iocb -> u .tmf .data )
2227+ rval = tm_iocb -> u .tmf .data ;
22262228
22272229done_free_sp :
22282230 /* ref: INIT */
@@ -4203,7 +4205,7 @@ void qla_init_iocb_limit(scsi_qla_host_t *vha)
42034205 u8 i ;
42044206 struct qla_hw_data * ha = vha -> hw ;
42054207
4206- __qla_adjust_iocb_limit (ha -> base_qpair );
4208+ __qla_adjust_iocb_limit (ha -> base_qpair );
42074209 ha -> base_qpair -> fwres .iocbs_used = 0 ;
42084210 ha -> base_qpair -> fwres .exch_used = 0 ;
42094211
@@ -4214,6 +4216,14 @@ void qla_init_iocb_limit(scsi_qla_host_t *vha)
42144216 ha -> queue_pair_map [i ]-> fwres .exch_used = 0 ;
42154217 }
42164218 }
4219+
4220+ ha -> fwres .iocb_total = ha -> orig_fw_iocb_count ;
4221+ ha -> fwres .iocb_limit = (ha -> orig_fw_iocb_count * QLA_IOCB_PCT_LIMIT ) / 100 ;
4222+ ha -> fwres .exch_total = ha -> orig_fw_xcb_count ;
4223+ ha -> fwres .exch_limit = (ha -> orig_fw_xcb_count * QLA_IOCB_PCT_LIMIT ) / 100 ;
4224+
4225+ atomic_set (& ha -> fwres .iocb_used , 0 );
4226+ atomic_set (& ha -> fwres .exch_used , 0 );
42174227}
42184228
42194229void qla_adjust_iocb_limit (scsi_qla_host_t * vha )
@@ -5554,6 +5564,7 @@ qla2x00_alloc_fcport(scsi_qla_host_t *vha, gfp_t flags)
55545564 INIT_WORK (& fcport -> reg_work , qla_register_fcport_fn );
55555565 INIT_LIST_HEAD (& fcport -> gnl_entry );
55565566 INIT_LIST_HEAD (& fcport -> list );
5567+ INIT_LIST_HEAD (& fcport -> unsol_ctx_head );
55575568
55585569 INIT_LIST_HEAD (& fcport -> sess_cmd_list );
55595570 spin_lock_init (& fcport -> sess_cmd_lock );
@@ -5596,7 +5607,7 @@ static void qla_get_login_template(scsi_qla_host_t *vha)
55965607 __be32 * q ;
55975608
55985609 memset (ha -> init_cb , 0 , ha -> init_cb_size );
5599- sz = min_t (int , sizeof (struct fc_els_csp ), ha -> init_cb_size );
5610+ sz = min_t (int , sizeof (struct fc_els_flogi ), ha -> init_cb_size );
56005611 rval = qla24xx_get_port_login_templ (vha , ha -> init_cb_dma ,
56015612 ha -> init_cb , sz );
56025613 if (rval != QLA_SUCCESS ) {
@@ -7390,14 +7401,15 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
73907401 }
73917402
73927403 /* purge MBox commands */
7393- if (atomic_read (& ha -> num_pend_mbx_stage3 )) {
7404+ spin_lock_irqsave (& ha -> hardware_lock , flags );
7405+ if (test_bit (MBX_INTR_WAIT , & ha -> mbx_cmd_flags )) {
73947406 clear_bit (MBX_INTR_WAIT , & ha -> mbx_cmd_flags );
73957407 complete (& ha -> mbx_intr_comp );
73967408 }
7409+ spin_unlock_irqrestore (& ha -> hardware_lock , flags );
73977410
73987411 i = 0 ;
7399- while (atomic_read (& ha -> num_pend_mbx_stage3 ) ||
7400- atomic_read (& ha -> num_pend_mbx_stage2 ) ||
7412+ while (atomic_read (& ha -> num_pend_mbx_stage2 ) ||
74017413 atomic_read (& ha -> num_pend_mbx_stage1 )) {
74027414 msleep (20 );
74037415 i ++ ;
@@ -9643,6 +9655,7 @@ struct qla_qpair *qla2xxx_create_qpair(struct scsi_qla_host *vha, int qos,
96439655 qpair -> vp_idx = vp_idx ;
96449656 qpair -> fw_started = ha -> flags .fw_started ;
96459657 INIT_LIST_HEAD (& qpair -> hints_list );
9658+ INIT_LIST_HEAD (& qpair -> dsd_list );
96469659 qpair -> chip_reset = ha -> base_qpair -> chip_reset ;
96479660 qpair -> enable_class_2 = ha -> base_qpair -> enable_class_2 ;
96489661 qpair -> enable_explicit_conf =
@@ -9771,6 +9784,19 @@ int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair)
97719784 if (ret != QLA_SUCCESS )
97729785 goto fail ;
97739786
9787+ if (!list_empty (& qpair -> dsd_list )) {
9788+ struct dsd_dma * dsd_ptr , * tdsd_ptr ;
9789+
9790+ /* clean up allocated prev pool */
9791+ list_for_each_entry_safe (dsd_ptr , tdsd_ptr ,
9792+ & qpair -> dsd_list , list ) {
9793+ dma_pool_free (ha -> dl_dma_pool , dsd_ptr -> dsd_addr ,
9794+ dsd_ptr -> dsd_list_dma );
9795+ list_del (& dsd_ptr -> list );
9796+ kfree (dsd_ptr );
9797+ }
9798+ }
9799+
97749800 mutex_lock (& ha -> mq_lock );
97759801 ha -> queue_pair_map [qpair -> id ] = NULL ;
97769802 clear_bit (qpair -> id , ha -> qpair_qid_map );
0 commit comments