@@ -1163,6 +1163,12 @@ mpi3mr_revalidate_factsdata(struct mpi3mr_ioc *mrioc)
1163
1163
return - EPERM ;
1164
1164
}
1165
1165
1166
+ if (mrioc -> shost -> max_sectors != (mrioc -> facts .max_data_length / 512 ))
1167
+ ioc_err (mrioc , "Warning: The maximum data transfer length\n"
1168
+ "\tchanged after reset: previous(%d), new(%d),\n"
1169
+ "the driver cannot change this at run time\n" ,
1170
+ mrioc -> shost -> max_sectors * 512 , mrioc -> facts .max_data_length );
1171
+
1166
1172
if ((mrioc -> sas_transport_enabled ) && (mrioc -> facts .ioc_capabilities &
1167
1173
MPI3_IOCFACTS_CAPABILITY_MULTIPATH_ENABLED ))
1168
1174
ioc_err (mrioc ,
@@ -2343,8 +2349,8 @@ static int mpi3mr_sync_timestamp(struct mpi3mr_ioc *mrioc)
2343
2349
ioc_err (mrioc , "Issue IOUCTL time_stamp: command timed out\n" );
2344
2350
mrioc -> init_cmds .is_waiting = 0 ;
2345
2351
if (!(mrioc -> init_cmds .state & MPI3MR_CMD_RESET ))
2346
- mpi3mr_soft_reset_handler (mrioc ,
2347
- MPI3MR_RESET_FROM_TSU_TIMEOUT , 1 );
2352
+ mpi3mr_check_rh_fault_ioc (mrioc ,
2353
+ MPI3MR_RESET_FROM_TSU_TIMEOUT );
2348
2354
retval = -1 ;
2349
2355
goto out_unlock ;
2350
2356
}
@@ -2856,6 +2862,7 @@ static void mpi3mr_process_factsdata(struct mpi3mr_ioc *mrioc,
2856
2862
le16_to_cpu (facts_data -> max_pcie_switches );
2857
2863
mrioc -> facts .max_sasexpanders =
2858
2864
le16_to_cpu (facts_data -> max_sas_expanders );
2865
+ mrioc -> facts .max_data_length = le16_to_cpu (facts_data -> max_data_length );
2859
2866
mrioc -> facts .max_sasinitiators =
2860
2867
le16_to_cpu (facts_data -> max_sas_initiators );
2861
2868
mrioc -> facts .max_enclosures = le16_to_cpu (facts_data -> max_enclosures );
@@ -2893,13 +2900,18 @@ static void mpi3mr_process_factsdata(struct mpi3mr_ioc *mrioc,
2893
2900
mrioc -> facts .io_throttle_high =
2894
2901
le16_to_cpu (facts_data -> io_throttle_high );
2895
2902
2903
+ if (mrioc -> facts .max_data_length ==
2904
+ MPI3_IOCFACTS_MAX_DATA_LENGTH_NOT_REPORTED )
2905
+ mrioc -> facts .max_data_length = MPI3MR_DEFAULT_MAX_IO_SIZE ;
2906
+ else
2907
+ mrioc -> facts .max_data_length *= MPI3MR_PAGE_SIZE_4K ;
2896
2908
/* Store in 512b block count */
2897
2909
if (mrioc -> facts .io_throttle_data_length )
2898
2910
mrioc -> io_throttle_data_length =
2899
2911
(mrioc -> facts .io_throttle_data_length * 2 * 4 );
2900
2912
else
2901
2913
/* set the length to 1MB + 1K to disable throttle */
2902
- mrioc -> io_throttle_data_length = MPI3MR_MAX_SECTORS + 2 ;
2914
+ mrioc -> io_throttle_data_length = ( mrioc -> facts . max_data_length / 512 ) + 2 ;
2903
2915
2904
2916
mrioc -> io_throttle_high = (mrioc -> facts .io_throttle_high * 2 * 1024 );
2905
2917
mrioc -> io_throttle_low = (mrioc -> facts .io_throttle_low * 2 * 1024 );
@@ -2914,9 +2926,9 @@ static void mpi3mr_process_factsdata(struct mpi3mr_ioc *mrioc,
2914
2926
ioc_info (mrioc , "SGEModMask 0x%x SGEModVal 0x%x SGEModShift 0x%x " ,
2915
2927
mrioc -> facts .sge_mod_mask , mrioc -> facts .sge_mod_value ,
2916
2928
mrioc -> facts .sge_mod_shift );
2917
- ioc_info (mrioc , "DMA mask %d InitialPE status 0x%x\n" ,
2929
+ ioc_info (mrioc , "DMA mask %d InitialPE status 0x%x max_data_len (%d) \n" ,
2918
2930
mrioc -> facts .dma_mask , (facts_flags &
2919
- MPI3_IOCFACTS_FLAGS_INITIAL_PORT_ENABLE_MASK ));
2931
+ MPI3_IOCFACTS_FLAGS_INITIAL_PORT_ENABLE_MASK ), mrioc -> facts . max_data_length );
2920
2932
ioc_info (mrioc ,
2921
2933
"max_dev_per_throttle_group(%d), max_throttle_groups(%d)\n" ,
2922
2934
mrioc -> facts .max_dev_per_tg , mrioc -> facts .max_io_throttle_group );
@@ -3359,8 +3371,8 @@ int mpi3mr_process_event_ack(struct mpi3mr_ioc *mrioc, u8 event,
3359
3371
if (!(mrioc -> init_cmds .state & MPI3MR_CMD_COMPLETE )) {
3360
3372
ioc_err (mrioc , "Issue EvtNotify: command timed out\n" );
3361
3373
if (!(mrioc -> init_cmds .state & MPI3MR_CMD_RESET ))
3362
- mpi3mr_soft_reset_handler (mrioc ,
3363
- MPI3MR_RESET_FROM_EVTACK_TIMEOUT , 1 );
3374
+ mpi3mr_check_rh_fault_ioc (mrioc ,
3375
+ MPI3MR_RESET_FROM_EVTACK_TIMEOUT );
3364
3376
retval = -1 ;
3365
3377
goto out_unlock ;
3366
3378
}
@@ -3414,7 +3426,14 @@ static int mpi3mr_alloc_chain_bufs(struct mpi3mr_ioc *mrioc)
3414
3426
if (!mrioc -> chain_sgl_list )
3415
3427
goto out_failed ;
3416
3428
3417
- sz = MPI3MR_PAGE_SIZE_4K ;
3429
+ if (mrioc -> max_sgl_entries > (mrioc -> facts .max_data_length /
3430
+ MPI3MR_PAGE_SIZE_4K ))
3431
+ mrioc -> max_sgl_entries = mrioc -> facts .max_data_length /
3432
+ MPI3MR_PAGE_SIZE_4K ;
3433
+ sz = mrioc -> max_sgl_entries * sizeof (struct mpi3_sge_common );
3434
+ ioc_info (mrioc , "number of sgl entries=%d chain buffer size=%dKB\n" ,
3435
+ mrioc -> max_sgl_entries , sz /1024 );
3436
+
3418
3437
mrioc -> chain_buf_pool = dma_pool_create ("chain_buf pool" ,
3419
3438
& mrioc -> pdev -> dev , sz , 16 , 0 );
3420
3439
if (!mrioc -> chain_buf_pool ) {
@@ -3813,7 +3832,7 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc)
3813
3832
}
3814
3833
3815
3834
mrioc -> max_host_ios = mrioc -> facts .max_reqs - MPI3MR_INTERNAL_CMDS_RESVD ;
3816
-
3835
+ mrioc -> shost -> max_sectors = mrioc -> facts . max_data_length / 512 ;
3817
3836
mrioc -> num_io_throttle_group = mrioc -> facts .max_io_throttle_group ;
3818
3837
atomic_set (& mrioc -> pend_large_data_sz , 0 );
3819
3838
0 commit comments