Skip to contentSkip to conversation

lib: sparse: call schedule() during image write

PATCH New Arnaud Ferraris 1 participant 1 message Nov 19 Library code

lore
Share & tools
lore
#0 lore raw

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.

---
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
index 48e5d8ee869..1dfa469b814 100644
@@ -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]>