|
76 | 76 | #define AUTO_UPDATE_INFO_SIZE SZ_1M
|
77 | 77 | #define AUTO_UPDATE_BITSTREAM_BASE (AUTO_UPDATE_DIRECTORY_SIZE + AUTO_UPDATE_INFO_SIZE)
|
78 | 78 |
|
79 |
| -#define AUTO_UPDATE_TIMEOUT_MS 60000 |
80 |
| - |
81 | 79 | struct mpfs_auto_update_priv {
|
82 | 80 | struct mpfs_sys_controller *sys_controller;
|
83 | 81 | struct device *dev;
|
84 | 82 | struct mtd_info *flash;
|
85 | 83 | struct fw_upload *fw_uploader;
|
86 |
| - struct completion programming_complete; |
87 | 84 | size_t size_per_bitstream;
|
88 | 85 | bool cancel_request;
|
89 | 86 | };
|
@@ -156,19 +153,6 @@ static void mpfs_auto_update_cancel(struct fw_upload *fw_uploader)
|
156 | 153 |
|
157 | 154 | static enum fw_upload_err mpfs_auto_update_poll_complete(struct fw_upload *fw_uploader)
|
158 | 155 | {
|
159 |
| - struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle; |
160 |
| - int ret; |
161 |
| - |
162 |
| - /* |
163 |
| - * There is no meaningful way to get the status of the programming while |
164 |
| - * it is in progress, so attempting anything other than waiting for it |
165 |
| - * to complete would be misplaced. |
166 |
| - */ |
167 |
| - ret = wait_for_completion_timeout(&priv->programming_complete, |
168 |
| - msecs_to_jiffies(AUTO_UPDATE_TIMEOUT_MS)); |
169 |
| - if (!ret) |
170 |
| - return FW_UPLOAD_ERR_TIMEOUT; |
171 |
| - |
172 | 156 | return FW_UPLOAD_ERR_NONE;
|
173 | 157 | }
|
174 | 158 |
|
@@ -349,33 +333,23 @@ static enum fw_upload_err mpfs_auto_update_write(struct fw_upload *fw_uploader,
|
349 | 333 | u32 offset, u32 size, u32 *written)
|
350 | 334 | {
|
351 | 335 | struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle;
|
352 |
| - enum fw_upload_err err = FW_UPLOAD_ERR_NONE; |
353 | 336 | int ret;
|
354 | 337 |
|
355 |
| - reinit_completion(&priv->programming_complete); |
356 |
| - |
357 | 338 | ret = mpfs_auto_update_write_bitstream(fw_uploader, data, offset, size, written);
|
358 |
| - if (ret) { |
359 |
| - err = FW_UPLOAD_ERR_RW_ERROR; |
360 |
| - goto out; |
361 |
| - } |
| 339 | + if (ret) |
| 340 | + return FW_UPLOAD_ERR_RW_ERROR; |
362 | 341 |
|
363 |
| - if (priv->cancel_request) { |
364 |
| - err = FW_UPLOAD_ERR_CANCELED; |
365 |
| - goto out; |
366 |
| - } |
| 342 | + if (priv->cancel_request) |
| 343 | + return FW_UPLOAD_ERR_CANCELED; |
367 | 344 |
|
368 | 345 | if (mpfs_auto_update_is_bitstream_info(data, size))
|
369 |
| - goto out; |
| 346 | + return FW_UPLOAD_ERR_NONE; |
370 | 347 |
|
371 | 348 | ret = mpfs_auto_update_verify_image(fw_uploader);
|
372 | 349 | if (ret)
|
373 |
| - err = FW_UPLOAD_ERR_FW_INVALID; |
| 350 | + return FW_UPLOAD_ERR_FW_INVALID; |
374 | 351 |
|
375 |
| -out: |
376 |
| - complete(&priv->programming_complete); |
377 |
| - |
378 |
| - return err; |
| 352 | + return FW_UPLOAD_ERR_NONE; |
379 | 353 | }
|
380 | 354 |
|
381 | 355 | static const struct fw_upload_ops mpfs_auto_update_ops = {
|
@@ -461,8 +435,6 @@ static int mpfs_auto_update_probe(struct platform_device *pdev)
|
461 | 435 | return dev_err_probe(dev, ret,
|
462 | 436 | "The current bitstream does not support auto-update\n");
|
463 | 437 |
|
464 |
| - init_completion(&priv->programming_complete); |
465 |
| - |
466 | 438 | fw_uploader = firmware_upload_register(THIS_MODULE, dev, "mpfs-auto-update",
|
467 | 439 | &mpfs_auto_update_ops, priv);
|
468 | 440 | if (IS_ERR(fw_uploader))
|
|
0 commit comments