lib: sparse: call schedule() during image write
PATCH 1/1 lib: sparse: call schedule() during image write
On some platforms, with a big enough fastboot buffer, the WDT might expire during the write, leaving the system in a broken state.
Calling schedule() (which in turn services the WDT) after each chunk is processed ensures this doesn't happen anymore, without any noticeable impact on performance.
Signed-off-by Arnaud Ferraris <[email protected]>
---
This was tested by flashing a 1.4GB image over USB on a Genio Pro 5100 EVK board with a 1GB buffer size, the longest write having taken ~24s, well over the 15s WDT timeout.
--- lib/image-sparse.c | 1 + 1 file changed, 1 insertion(+)
lib/image-sparse.c +1 -0
@@ -303,6 +303,7 @@ int write_sparse_image(struct sparse_storage *info, info->mssg ("Unknown chunk type" , response);return -1 ; } +schedule (); } debug("Wrote %d blocks, expected to write %d blocks\n",
---
base-commit: fd64f94c4404609b9abef32494396dbaaacec62c
change-id: 20261119-sparse-schedule-450a48e2b44d
Best regards,
Signature · 1 line
Arnaud Ferraris <[email protected]>