usb: reload watchdog during ums command
authorPatrick Delaunay <patrick.delaunay@st.com>
Thu, 18 Apr 2019 15:18:39 +0000 (17:18 +0200)
committerMarek Vasut <marex@denx.de>
Sun, 21 Apr 2019 08:26:52 +0000 (10:26 +0200)
Reload the watchdog in the mass storage command ums
to avoid reboot during the usb waiting loop
when the host doesn't send any request.

Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
cmd/usb_mass_storage.c

index 753ae4f..570cf3a 100644 (file)
@@ -14,6 +14,7 @@
 #include <part.h>
 #include <usb.h>
 #include <usb_mass_storage.h>
+#include <watchdog.h>
 
 static int ums_read_sector(struct ums *ums_dev,
                           ulong start, lbaint_t blkcnt, void *buf)
@@ -226,6 +227,8 @@ static int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
                        rc = CMD_RET_SUCCESS;
                        goto cleanup_register;
                }
+
+               WATCHDOG_RESET();
        }
 
 cleanup_register: