@@ -219,7 +219,8 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job)
219
219
break ;
220
220
}
221
221
exit_fcp_prio_cfg :
222
- bsg_job -> job_done (bsg_job );
222
+ if (!ret )
223
+ bsg_job -> job_done (bsg_job );
223
224
return ret ;
224
225
}
225
226
@@ -741,7 +742,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
741
742
if (qla81xx_get_port_config (vha , config )) {
742
743
ql_log (ql_log_warn , vha , 0x701f ,
743
744
"Get port config failed.\n" );
744
- bsg_job -> reply -> result = (DID_ERROR << 16 );
745
745
rval = - EPERM ;
746
746
goto done_free_dma_req ;
747
747
}
@@ -761,7 +761,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
761
761
new_config , elreq .options );
762
762
763
763
if (rval ) {
764
- bsg_job -> reply -> result = (DID_ERROR << 16 );
765
764
rval = - EPERM ;
766
765
goto done_free_dma_req ;
767
766
}
@@ -795,7 +794,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
795
794
"MPI reset failed.\n" );
796
795
}
797
796
798
- bsg_job -> reply -> result = (DID_ERROR << 16 );
799
797
rval = - EIO ;
800
798
goto done_free_dma_req ;
801
799
}
@@ -812,33 +810,25 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
812
810
ql_log (ql_log_warn , vha , 0x702c ,
813
811
"Vendor request %s failed.\n" , type );
814
812
815
- fw_sts_ptr = ((uint8_t * )bsg_job -> req -> sense ) +
816
- sizeof (struct fc_bsg_reply );
817
-
818
- memcpy (fw_sts_ptr , response , sizeof (response ));
819
- fw_sts_ptr += sizeof (response );
820
- * fw_sts_ptr = command_sent ;
821
813
rval = 0 ;
822
814
bsg_job -> reply -> result = (DID_ERROR << 16 );
815
+ bsg_job -> reply -> reply_payload_rcv_len = 0 ;
823
816
} else {
824
817
ql_dbg (ql_dbg_user , vha , 0x702d ,
825
818
"Vendor request %s completed.\n" , type );
826
-
827
- bsg_job -> reply_len = sizeof (struct fc_bsg_reply ) +
828
- sizeof (response ) + sizeof (uint8_t );
829
- bsg_job -> reply -> reply_payload_rcv_len =
830
- bsg_job -> reply_payload .payload_len ;
831
- fw_sts_ptr = ((uint8_t * )bsg_job -> req -> sense ) +
832
- sizeof (struct fc_bsg_reply );
833
- memcpy (fw_sts_ptr , response , sizeof (response ));
834
- fw_sts_ptr += sizeof (response );
835
- * fw_sts_ptr = command_sent ;
836
- bsg_job -> reply -> result = DID_OK ;
819
+ bsg_job -> reply -> result = (DID_OK << 16 );
837
820
sg_copy_from_buffer (bsg_job -> reply_payload .sg_list ,
838
821
bsg_job -> reply_payload .sg_cnt , rsp_data ,
839
822
rsp_data_len );
840
823
}
841
- bsg_job -> job_done (bsg_job );
824
+
825
+ bsg_job -> reply_len = sizeof (struct fc_bsg_reply ) +
826
+ sizeof (response ) + sizeof (uint8_t );
827
+ fw_sts_ptr = ((uint8_t * )bsg_job -> req -> sense ) +
828
+ sizeof (struct fc_bsg_reply );
829
+ memcpy (fw_sts_ptr , response , sizeof (response ));
830
+ fw_sts_ptr += sizeof (response );
831
+ * fw_sts_ptr = command_sent ;
842
832
843
833
dma_free_coherent (& ha -> pdev -> dev , rsp_data_len ,
844
834
rsp_data , rsp_data_dma );
@@ -853,6 +843,8 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
853
843
dma_unmap_sg (& ha -> pdev -> dev ,
854
844
bsg_job -> request_payload .sg_list ,
855
845
bsg_job -> request_payload .sg_cnt , DMA_TO_DEVICE );
846
+ if (!rval )
847
+ bsg_job -> job_done (bsg_job );
856
848
return rval ;
857
849
}
858
850
@@ -877,16 +869,15 @@ qla84xx_reset(struct fc_bsg_job *bsg_job)
877
869
if (rval ) {
878
870
ql_log (ql_log_warn , vha , 0x7030 ,
879
871
"Vendor request 84xx reset failed.\n" );
880
- rval = 0 ;
881
- bsg_job -> reply -> result = (DID_ERROR << 16 );
872
+ rval = (DID_ERROR << 16 );
882
873
883
874
} else {
884
875
ql_dbg (ql_dbg_user , vha , 0x7031 ,
885
876
"Vendor request 84xx reset completed.\n" );
886
877
bsg_job -> reply -> result = DID_OK ;
878
+ bsg_job -> job_done (bsg_job );
887
879
}
888
880
889
- bsg_job -> job_done (bsg_job );
890
881
return rval ;
891
882
}
892
883
@@ -976,8 +967,7 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job)
976
967
ql_log (ql_log_warn , vha , 0x7037 ,
977
968
"Vendor request 84xx updatefw failed.\n" );
978
969
979
- rval = 0 ;
980
- bsg_job -> reply -> result = (DID_ERROR << 16 );
970
+ rval = (DID_ERROR << 16 );
981
971
} else {
982
972
ql_dbg (ql_dbg_user , vha , 0x7038 ,
983
973
"Vendor request 84xx updatefw completed.\n" );
@@ -986,7 +976,6 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job)
986
976
bsg_job -> reply -> result = DID_OK ;
987
977
}
988
978
989
- bsg_job -> job_done (bsg_job );
990
979
dma_pool_free (ha -> s_dma_pool , mn , mn_dma );
991
980
992
981
done_free_fw_buf :
@@ -996,6 +985,8 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job)
996
985
dma_unmap_sg (& ha -> pdev -> dev , bsg_job -> request_payload .sg_list ,
997
986
bsg_job -> request_payload .sg_cnt , DMA_TO_DEVICE );
998
987
988
+ if (!rval )
989
+ bsg_job -> job_done (bsg_job );
999
990
return rval ;
1000
991
}
1001
992
@@ -1163,8 +1154,7 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
1163
1154
ql_log (ql_log_warn , vha , 0x7043 ,
1164
1155
"Vendor request 84xx mgmt failed.\n" );
1165
1156
1166
- rval = 0 ;
1167
- bsg_job -> reply -> result = (DID_ERROR << 16 );
1157
+ rval = (DID_ERROR << 16 );
1168
1158
1169
1159
} else {
1170
1160
ql_dbg (ql_dbg_user , vha , 0x7044 ,
@@ -1184,8 +1174,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
1184
1174
}
1185
1175
}
1186
1176
1187
- bsg_job -> job_done (bsg_job );
1188
-
1189
1177
done_unmap_sg :
1190
1178
if (mgmt_b )
1191
1179
dma_free_coherent (& ha -> pdev -> dev , data_len , mgmt_b , mgmt_dma );
@@ -1200,6 +1188,8 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
1200
1188
exit_mgmt :
1201
1189
dma_pool_free (ha -> s_dma_pool , mn , mn_dma );
1202
1190
1191
+ if (!rval )
1192
+ bsg_job -> job_done (bsg_job );
1203
1193
return rval ;
1204
1194
}
1205
1195
@@ -1276,9 +1266,7 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
1276
1266
fcport -> port_name [3 ], fcport -> port_name [4 ],
1277
1267
fcport -> port_name [5 ], fcport -> port_name [6 ],
1278
1268
fcport -> port_name [7 ], rval , fcport -> fp_speed , mb [0 ], mb [1 ]);
1279
- rval = 0 ;
1280
- bsg_job -> reply -> result = (DID_ERROR << 16 );
1281
-
1269
+ rval = (DID_ERROR << 16 );
1282
1270
} else {
1283
1271
if (!port_param -> mode ) {
1284
1272
bsg_job -> reply_len = sizeof (struct fc_bsg_reply ) +
@@ -1292,9 +1280,9 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
1292
1280
}
1293
1281
1294
1282
bsg_job -> reply -> result = DID_OK ;
1283
+ bsg_job -> job_done (bsg_job );
1295
1284
}
1296
1285
1297
- bsg_job -> job_done (bsg_job );
1298
1286
return rval ;
1299
1287
}
1300
1288
@@ -1887,8 +1875,6 @@ qla2x00_process_vendor_specific(struct fc_bsg_job *bsg_job)
1887
1875
return qla24xx_process_bidir_cmd (bsg_job );
1888
1876
1889
1877
default :
1890
- bsg_job -> reply -> result = (DID_ERROR << 16 );
1891
- bsg_job -> job_done (bsg_job );
1892
1878
return - ENOSYS ;
1893
1879
}
1894
1880
}
@@ -1919,8 +1905,6 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
1919
1905
ql_dbg (ql_dbg_user , vha , 0x709f ,
1920
1906
"BSG: ISP abort active/needed -- cmd=%d.\n" ,
1921
1907
bsg_job -> request -> msgcode );
1922
- bsg_job -> reply -> result = (DID_ERROR << 16 );
1923
- bsg_job -> job_done (bsg_job );
1924
1908
return - EBUSY ;
1925
1909
}
1926
1910
@@ -1943,7 +1927,6 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
1943
1927
case FC_BSG_RPT_CT :
1944
1928
default :
1945
1929
ql_log (ql_log_warn , vha , 0x705a , "Unsupported BSG request.\n" );
1946
- bsg_job -> reply -> result = ret ;
1947
1930
break ;
1948
1931
}
1949
1932
return ret ;
0 commit comments