@@ -3053,7 +3053,6 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
3053
3053
struct smp_completion_resp * psmpPayload ;
3054
3054
struct task_status_struct * ts ;
3055
3055
struct pm8001_device * pm8001_dev ;
3056
- char * pdma_respaddr = NULL ;
3057
3056
3058
3057
psmpPayload = (struct smp_completion_resp * )(piomb + 4 );
3059
3058
status = le32_to_cpu (psmpPayload -> status );
@@ -3080,19 +3079,23 @@ mpi_smp_completion(struct pm8001_hba_info *pm8001_ha, void *piomb)
3080
3079
if (pm8001_dev )
3081
3080
atomic_dec (& pm8001_dev -> running_req );
3082
3081
if (pm8001_ha -> smp_exp_mode == SMP_DIRECT ) {
3082
+ struct scatterlist * sg_resp = & t -> smp_task .smp_resp ;
3083
+ u8 * payload ;
3084
+ void * to ;
3085
+
3083
3086
pm8001_dbg (pm8001_ha , IO ,
3084
3087
"DIRECT RESPONSE Length:%d\n" ,
3085
3088
param );
3086
- pdma_respaddr = (char * )(phys_to_virt (cpu_to_le64
3087
- ((u64 )sg_dma_address
3088
- (& t -> smp_task .smp_resp ))));
3089
+ to = kmap_atomic (sg_page (sg_resp ));
3090
+ payload = to + sg_resp -> offset ;
3089
3091
for (i = 0 ; i < param ; i ++ ) {
3090
- * (pdma_respaddr + i ) = psmpPayload -> _r_a [i ];
3092
+ * (payload + i ) = psmpPayload -> _r_a [i ];
3091
3093
pm8001_dbg (pm8001_ha , IO ,
3092
3094
"SMP Byte%d DMA data 0x%x psmp 0x%x\n" ,
3093
- i , * (pdma_respaddr + i ),
3095
+ i , * (payload + i ),
3094
3096
psmpPayload -> _r_a [i ]);
3095
3097
}
3098
+ kunmap_atomic (to );
3096
3099
}
3097
3100
break ;
3098
3101
case IO_ABORTED :
@@ -4236,14 +4239,14 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
4236
4239
struct sas_task * task = ccb -> task ;
4237
4240
struct domain_device * dev = task -> dev ;
4238
4241
struct pm8001_device * pm8001_dev = dev -> lldd_dev ;
4239
- struct scatterlist * sg_req , * sg_resp ;
4242
+ struct scatterlist * sg_req , * sg_resp , * smp_req ;
4240
4243
u32 req_len , resp_len ;
4241
4244
struct smp_req smp_cmd ;
4242
4245
u32 opc ;
4243
4246
struct inbound_queue_table * circularQ ;
4244
- char * preq_dma_addr = NULL ;
4245
- __le64 tmp_addr ;
4246
4247
u32 i , length ;
4248
+ u8 * payload ;
4249
+ u8 * to ;
4247
4250
4248
4251
memset (& smp_cmd , 0 , sizeof (smp_cmd ));
4249
4252
/*
@@ -4280,16 +4283,17 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
4280
4283
pm8001_ha -> smp_exp_mode = SMP_INDIRECT ;
4281
4284
4282
4285
4283
- tmp_addr = cpu_to_le64 ((u64 )sg_dma_address (& task -> smp_task .smp_req ));
4284
- preq_dma_addr = (char * )phys_to_virt (tmp_addr );
4286
+ smp_req = & task -> smp_task .smp_req ;
4287
+ to = kmap_atomic (sg_page (smp_req ));
4288
+ payload = to + smp_req -> offset ;
4285
4289
4286
4290
/* INDIRECT MODE command settings. Use DMA */
4287
4291
if (pm8001_ha -> smp_exp_mode == SMP_INDIRECT ) {
4288
4292
pm8001_dbg (pm8001_ha , IO , "SMP REQUEST INDIRECT MODE\n" );
4289
4293
/* for SPCv indirect mode. Place the top 4 bytes of
4290
4294
* SMP Request header here. */
4291
4295
for (i = 0 ; i < 4 ; i ++ )
4292
- smp_cmd .smp_req16 [i ] = * (preq_dma_addr + i );
4296
+ smp_cmd .smp_req16 [i ] = * (payload + i );
4293
4297
/* exclude top 4 bytes for SMP req header */
4294
4298
smp_cmd .long_smp_req .long_req_addr =
4295
4299
cpu_to_le64 ((u64 )sg_dma_address
@@ -4320,20 +4324,20 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
4320
4324
pm8001_dbg (pm8001_ha , IO , "SMP REQUEST DIRECT MODE\n" );
4321
4325
for (i = 0 ; i < length ; i ++ )
4322
4326
if (i < 16 ) {
4323
- smp_cmd .smp_req16 [i ] = * (preq_dma_addr + i );
4327
+ smp_cmd .smp_req16 [i ] = * (payload + i );
4324
4328
pm8001_dbg (pm8001_ha , IO ,
4325
4329
"Byte[%d]:%x (DMA data:%x)\n" ,
4326
4330
i , smp_cmd .smp_req16 [i ],
4327
- * (preq_dma_addr ));
4331
+ * (payload ));
4328
4332
} else {
4329
- smp_cmd .smp_req [i ] = * (preq_dma_addr + i );
4333
+ smp_cmd .smp_req [i ] = * (payload + i );
4330
4334
pm8001_dbg (pm8001_ha , IO ,
4331
4335
"Byte[%d]:%x (DMA data:%x)\n" ,
4332
4336
i , smp_cmd .smp_req [i ],
4333
- * (preq_dma_addr ));
4337
+ * (payload ));
4334
4338
}
4335
4339
}
4336
-
4340
+ kunmap_atomic ( to );
4337
4341
build_smp_cmd (pm8001_dev -> device_id , smp_cmd .tag ,
4338
4342
& smp_cmd , pm8001_ha -> smp_exp_mode , length );
4339
4343
rc = pm8001_mpi_build_cmd (pm8001_ha , circularQ , opc , & smp_cmd ,
0 commit comments