@@ -2669,6 +2669,40 @@ qla83xx_nic_core_fw_load(scsi_qla_host_t *vha)
2669
2669
return rval ;
2670
2670
}
2671
2671
2672
+ static void qla_enable_fce_trace (scsi_qla_host_t * vha )
2673
+ {
2674
+ int rval ;
2675
+ struct qla_hw_data * ha = vha -> hw ;
2676
+
2677
+ if (ha -> fce ) {
2678
+ ha -> flags .fce_enabled = 1 ;
2679
+ memset (ha -> fce , 0 , fce_calc_size (ha -> fce_bufs ));
2680
+ rval = qla2x00_enable_fce_trace (vha ,
2681
+ ha -> fce_dma , ha -> fce_bufs , ha -> fce_mb , & ha -> fce_bufs );
2682
+
2683
+ if (rval ) {
2684
+ ql_log (ql_log_warn , vha , 0x8033 ,
2685
+ "Unable to reinitialize FCE (%d).\n" , rval );
2686
+ ha -> flags .fce_enabled = 0 ;
2687
+ }
2688
+ }
2689
+ }
2690
+
2691
+ static void qla_enable_eft_trace (scsi_qla_host_t * vha )
2692
+ {
2693
+ int rval ;
2694
+ struct qla_hw_data * ha = vha -> hw ;
2695
+
2696
+ if (ha -> eft ) {
2697
+ memset (ha -> eft , 0 , EFT_SIZE );
2698
+ rval = qla2x00_enable_eft_trace (vha , ha -> eft_dma , EFT_NUM_BUFFERS );
2699
+
2700
+ if (rval ) {
2701
+ ql_log (ql_log_warn , vha , 0x8034 ,
2702
+ "Unable to reinitialize EFT (%d).\n" , rval );
2703
+ }
2704
+ }
2705
+ }
2672
2706
/*
2673
2707
* qla2x00_initialize_adapter
2674
2708
* Initialize board.
@@ -3672,9 +3706,8 @@ qla24xx_chip_diag(scsi_qla_host_t *vha)
3672
3706
}
3673
3707
3674
3708
static void
3675
- qla2x00_init_fce_trace (scsi_qla_host_t * vha )
3709
+ qla2x00_alloc_fce_trace (scsi_qla_host_t * vha )
3676
3710
{
3677
- int rval ;
3678
3711
dma_addr_t tc_dma ;
3679
3712
void * tc ;
3680
3713
struct qla_hw_data * ha = vha -> hw ;
@@ -3703,27 +3736,17 @@ qla2x00_init_fce_trace(scsi_qla_host_t *vha)
3703
3736
return ;
3704
3737
}
3705
3738
3706
- rval = qla2x00_enable_fce_trace (vha , tc_dma , FCE_NUM_BUFFERS ,
3707
- ha -> fce_mb , & ha -> fce_bufs );
3708
- if (rval ) {
3709
- ql_log (ql_log_warn , vha , 0x00bf ,
3710
- "Unable to initialize FCE (%d).\n" , rval );
3711
- dma_free_coherent (& ha -> pdev -> dev , FCE_SIZE , tc , tc_dma );
3712
- return ;
3713
- }
3714
-
3715
3739
ql_dbg (ql_dbg_init , vha , 0x00c0 ,
3716
3740
"Allocated (%d KB) for FCE...\n" , FCE_SIZE / 1024 );
3717
3741
3718
- ha -> flags .fce_enabled = 1 ;
3719
3742
ha -> fce_dma = tc_dma ;
3720
3743
ha -> fce = tc ;
3744
+ ha -> fce_bufs = FCE_NUM_BUFFERS ;
3721
3745
}
3722
3746
3723
3747
static void
3724
- qla2x00_init_eft_trace (scsi_qla_host_t * vha )
3748
+ qla2x00_alloc_eft_trace (scsi_qla_host_t * vha )
3725
3749
{
3726
- int rval ;
3727
3750
dma_addr_t tc_dma ;
3728
3751
void * tc ;
3729
3752
struct qla_hw_data * ha = vha -> hw ;
@@ -3748,28 +3771,13 @@ qla2x00_init_eft_trace(scsi_qla_host_t *vha)
3748
3771
return ;
3749
3772
}
3750
3773
3751
- rval = qla2x00_enable_eft_trace (vha , tc_dma , EFT_NUM_BUFFERS );
3752
- if (rval ) {
3753
- ql_log (ql_log_warn , vha , 0x00c2 ,
3754
- "Unable to initialize EFT (%d).\n" , rval );
3755
- dma_free_coherent (& ha -> pdev -> dev , EFT_SIZE , tc , tc_dma );
3756
- return ;
3757
- }
3758
-
3759
3774
ql_dbg (ql_dbg_init , vha , 0x00c3 ,
3760
3775
"Allocated (%d KB) EFT ...\n" , EFT_SIZE / 1024 );
3761
3776
3762
3777
ha -> eft_dma = tc_dma ;
3763
3778
ha -> eft = tc ;
3764
3779
}
3765
3780
3766
- static void
3767
- qla2x00_alloc_offload_mem (scsi_qla_host_t * vha )
3768
- {
3769
- qla2x00_init_fce_trace (vha );
3770
- qla2x00_init_eft_trace (vha );
3771
- }
3772
-
3773
3781
void
3774
3782
qla2x00_alloc_fw_dump (scsi_qla_host_t * vha )
3775
3783
{
@@ -3824,10 +3832,10 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
3824
3832
if (ha -> tgt .atio_ring )
3825
3833
mq_size += ha -> tgt .atio_q_length * sizeof (request_t );
3826
3834
3827
- qla2x00_init_fce_trace (vha );
3835
+ qla2x00_alloc_fce_trace (vha );
3828
3836
if (ha -> fce )
3829
3837
fce_size = sizeof (struct qla2xxx_fce_chain ) + FCE_SIZE ;
3830
- qla2x00_init_eft_trace (vha );
3838
+ qla2x00_alloc_eft_trace (vha );
3831
3839
if (ha -> eft )
3832
3840
eft_size = EFT_SIZE ;
3833
3841
}
@@ -4257,7 +4265,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
4257
4265
struct qla_hw_data * ha = vha -> hw ;
4258
4266
struct device_reg_2xxx __iomem * reg = & ha -> iobase -> isp ;
4259
4267
unsigned long flags ;
4260
- uint16_t fw_major_version ;
4261
4268
int done_once = 0 ;
4262
4269
4263
4270
if (IS_P3P_TYPE (ha )) {
@@ -4324,7 +4331,6 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
4324
4331
goto failed ;
4325
4332
4326
4333
enable_82xx_npiv :
4327
- fw_major_version = ha -> fw_major_version ;
4328
4334
if (IS_P3P_TYPE (ha ))
4329
4335
qla82xx_check_md_needed (vha );
4330
4336
else
@@ -4353,12 +4359,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
4353
4359
if (rval != QLA_SUCCESS )
4354
4360
goto failed ;
4355
4361
4356
- if (!fw_major_version && !(IS_P3P_TYPE (ha )))
4357
- qla2x00_alloc_offload_mem (vha );
4358
-
4359
4362
if (ql2xallocfwdump && !(IS_P3P_TYPE (ha )))
4360
4363
qla2x00_alloc_fw_dump (vha );
4361
4364
4365
+ qla_enable_fce_trace (vha );
4366
+ qla_enable_eft_trace (vha );
4362
4367
} else {
4363
4368
goto failed ;
4364
4369
}
@@ -7491,7 +7496,6 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha)
7491
7496
int
7492
7497
qla2x00_abort_isp (scsi_qla_host_t * vha )
7493
7498
{
7494
- int rval ;
7495
7499
uint8_t status = 0 ;
7496
7500
struct qla_hw_data * ha = vha -> hw ;
7497
7501
struct scsi_qla_host * vp , * tvp ;
@@ -7585,31 +7589,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
7585
7589
7586
7590
if (IS_QLA81XX (ha ) || IS_QLA8031 (ha ))
7587
7591
qla2x00_get_fw_version (vha );
7588
- if (ha -> fce ) {
7589
- ha -> flags .fce_enabled = 1 ;
7590
- memset (ha -> fce , 0 ,
7591
- fce_calc_size (ha -> fce_bufs ));
7592
- rval = qla2x00_enable_fce_trace (vha ,
7593
- ha -> fce_dma , ha -> fce_bufs , ha -> fce_mb ,
7594
- & ha -> fce_bufs );
7595
- if (rval ) {
7596
- ql_log (ql_log_warn , vha , 0x8033 ,
7597
- "Unable to reinitialize FCE "
7598
- "(%d).\n" , rval );
7599
- ha -> flags .fce_enabled = 0 ;
7600
- }
7601
- }
7602
7592
7603
- if (ha -> eft ) {
7604
- memset (ha -> eft , 0 , EFT_SIZE );
7605
- rval = qla2x00_enable_eft_trace (vha ,
7606
- ha -> eft_dma , EFT_NUM_BUFFERS );
7607
- if (rval ) {
7608
- ql_log (ql_log_warn , vha , 0x8034 ,
7609
- "Unable to reinitialize EFT "
7610
- "(%d).\n" , rval );
7611
- }
7612
- }
7613
7593
} else { /* failed the ISP abort */
7614
7594
vha -> flags .online = 1 ;
7615
7595
if (test_bit (ISP_ABORT_RETRY , & vha -> dpc_flags )) {
0 commit comments