diff options
-rw-r--r-- | drivers/crypto/qat/qat_common/qat_uclo.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/crypto/qat/qat_common/qat_uclo.c b/drivers/crypto/qat/qat_common/qat_uclo.c index dd4e0d3c323a..f22b48889d33 100644 --- a/drivers/crypto/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/qat/qat_common/qat_uclo.c | |||
@@ -1088,14 +1088,13 @@ static void qat_uclo_fill_uwords(struct icp_qat_uclo_objhandle *obj_handle, | |||
1088 | *uword = fill; | 1088 | *uword = fill; |
1089 | } | 1089 | } |
1090 | 1090 | ||
1091 | static int qat_uclo_wr_uimage_raw_page(struct icp_qat_fw_loader_handle *handle, | 1091 | static void qat_uclo_wr_uimage_raw_page(struct icp_qat_fw_loader_handle *handle, |
1092 | struct icp_qat_uclo_encap_page | 1092 | struct icp_qat_uclo_encap_page |
1093 | *encap_page, unsigned int ae) | 1093 | *encap_page, unsigned int ae) |
1094 | { | 1094 | { |
1095 | unsigned int uw_physical_addr, uw_relative_addr, i, words_num, cpylen; | 1095 | unsigned int uw_physical_addr, uw_relative_addr, i, words_num, cpylen; |
1096 | struct icp_qat_uclo_objhandle *obj_handle = handle->obj_handle; | 1096 | struct icp_qat_uclo_objhandle *obj_handle = handle->obj_handle; |
1097 | uint64_t fill_pat; | 1097 | uint64_t fill_pat; |
1098 | int status = 0; | ||
1099 | 1098 | ||
1100 | /* load the page starting at appropriate ustore address */ | 1099 | /* load the page starting at appropriate ustore address */ |
1101 | /* get fill-pattern from an image -- they are all the same */ | 1100 | /* get fill-pattern from an image -- they are all the same */ |
@@ -1126,18 +1125,15 @@ static int qat_uclo_wr_uimage_raw_page(struct icp_qat_fw_loader_handle *handle, | |||
1126 | uw_relative_addr += cpylen; | 1125 | uw_relative_addr += cpylen; |
1127 | words_num -= cpylen; | 1126 | words_num -= cpylen; |
1128 | } | 1127 | } |
1129 | return status; | ||
1130 | } | 1128 | } |
1131 | 1129 | ||
1132 | static int | 1130 | static void qat_uclo_wr_uimage_pages(struct icp_qat_fw_loader_handle *handle, |
1133 | qat_uclo_wr_uimage_pages(struct icp_qat_fw_loader_handle *handle, | 1131 | struct icp_qat_uof_image *image) |
1134 | struct icp_qat_uof_image *image) | ||
1135 | { | 1132 | { |
1136 | struct icp_qat_uclo_objhandle *obj_handle = handle->obj_handle; | 1133 | struct icp_qat_uclo_objhandle *obj_handle = handle->obj_handle; |
1137 | unsigned int ctx_mask, s; | 1134 | unsigned int ctx_mask, s; |
1138 | struct icp_qat_uclo_page *page; | 1135 | struct icp_qat_uclo_page *page; |
1139 | unsigned char ae; | 1136 | unsigned char ae; |
1140 | int retval = 0; | ||
1141 | int ctx; | 1137 | int ctx; |
1142 | 1138 | ||
1143 | if (ICP_QAT_CTX_MODE(image->ae_mode) == ICP_QAT_UCLO_MAX_CTX) | 1139 | if (ICP_QAT_CTX_MODE(image->ae_mode) == ICP_QAT_UCLO_MAX_CTX) |
@@ -1160,8 +1156,7 @@ qat_uclo_wr_uimage_pages(struct icp_qat_fw_loader_handle *handle, | |||
1160 | page = obj_handle->ae_data[ae].ae_slices[s].page; | 1156 | page = obj_handle->ae_data[ae].ae_slices[s].page; |
1161 | if (!page->encap_page->def_page) | 1157 | if (!page->encap_page->def_page) |
1162 | continue; | 1158 | continue; |
1163 | if (qat_uclo_wr_uimage_raw_page(handle, page->encap_page, ae)) | 1159 | qat_uclo_wr_uimage_raw_page(handle, page->encap_page, ae); |
1164 | return -EINVAL; | ||
1165 | 1160 | ||
1166 | page = obj_handle->ae_data[ae].ae_slices[s].page; | 1161 | page = obj_handle->ae_data[ae].ae_slices[s].page; |
1167 | for (ctx = 0; ctx < ICP_QAT_UCLO_MAX_CTX; ctx++) | 1162 | for (ctx = 0; ctx < ICP_QAT_UCLO_MAX_CTX; ctx++) |
@@ -1172,7 +1167,6 @@ qat_uclo_wr_uimage_pages(struct icp_qat_fw_loader_handle *handle, | |||
1172 | qat_hal_set_pc(handle, (unsigned char)ae, image->ctx_assigned, | 1167 | qat_hal_set_pc(handle, (unsigned char)ae, image->ctx_assigned, |
1173 | image->entry_address); | 1168 | image->entry_address); |
1174 | } | 1169 | } |
1175 | return retval; | ||
1176 | } | 1170 | } |
1177 | 1171 | ||
1178 | int qat_uclo_wr_all_uimage(struct icp_qat_fw_loader_handle *handle) | 1172 | int qat_uclo_wr_all_uimage(struct icp_qat_fw_loader_handle *handle) |
@@ -1187,9 +1181,8 @@ int qat_uclo_wr_all_uimage(struct icp_qat_fw_loader_handle *handle) | |||
1187 | return -EINVAL; | 1181 | return -EINVAL; |
1188 | if (qat_uclo_init_ustore(handle, &(obj_handle->ae_uimage[i]))) | 1182 | if (qat_uclo_init_ustore(handle, &(obj_handle->ae_uimage[i]))) |
1189 | return -EINVAL; | 1183 | return -EINVAL; |
1190 | if (qat_uclo_wr_uimage_pages(handle, | 1184 | qat_uclo_wr_uimage_pages(handle, |
1191 | obj_handle->ae_uimage[i].img_ptr)) | 1185 | obj_handle->ae_uimage[i].img_ptr); |
1192 | return -EINVAL; | ||
1193 | } | 1186 | } |
1194 | return 0; | 1187 | return 0; |
1195 | } | 1188 | } |