[RFC,2/3] lib: lz4: wire up watchdog keepalive during decompression
diff mbox series

Message ID 20191017114906.30302-3-linux@rasmusvillemoes.dk
State New
Headers show
  • watchdog servicing during decompression
Related show

Commit Message

Rasmus Villemoes Oct. 17, 2019, 11:49 a.m. UTC
Some boards have a hardware watchdog that (a) cannot be disabled
and (b) has a timeout short enough that there's no chance for the
kernel to get through decompression, let alone reach the
initialization of the appropriate watchdog device driver.

In order to allow booting such boards, the decompression routine needs
to service the watchdog in its main loop. This wires up lz4 to do that
via the decompress_keepalive() macro defined in the new

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
 lib/lz4/lz4_decompress.c | 2 ++
 1 file changed, 2 insertions(+)

diff mbox series

diff --git a/lib/lz4/lz4_decompress.c b/lib/lz4/lz4_decompress.c
index 0c9d3ad17e0f..54ba41d073a6 100644
--- a/lib/lz4/lz4_decompress.c
+++ b/lib/lz4/lz4_decompress.c
@@ -39,6 +39,7 @@ 
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <asm/unaligned.h>
+#include <linux/decompress/keepalive.h>
  *	Decompression functions
@@ -129,6 +130,7 @@  static FORCE_INLINE int LZ4_decompress_generic(
 		/* ip < iend before the increment */
 		assert(!endOnInput || ip <= iend);
+		decompress_keepalive();
 		 * A two-stage shortcut for the most common case: